Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - img scr tag: how to specify the border color?

 
Thread Tools Search this Thread
Old 06-16-2004, 07:52 PM   #1
Default img scr tag: how to specify the border color?


Hello folks,


I'm a newby in webdesign and have a question:

<a href="Bild0278.jpg" target="_blank">
<img src="Bild0278.jpg" width="100"
height="75" alt="Vorschau" border="1" bordercolor="black">
</a>

My browser doesn't make a black border round my picture.

What is wrong?

thx for your help

best regards,

Micha


-------------
People who think to be too important for small tasks are often too small for
important tasks!




Michael Westphal
  Reply With Quote
Old 06-16-2004, 08:08 PM   #2
David Dorward
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

Michael Westphal wrote:

> height="75" alt="Vorschau" border="1" bordercolor="black">
> My browser doesn't make a black border round my picture.


> What is wrong?


You are guessing at attributes instead of using the manual
<http://w3.org/TR/html4/>, checking your got your syntax correct
<http://validator.w3.org/> and using a presentation tool for presentation
<http://w3.org/TR/CSS2/>, <http://dorward.me.uk/www/css/#tutorials>


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
  Reply With Quote
Old 06-16-2004, 08:18 PM   #3
Michael Westphal
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

I've forgotten something:

I meant:

my browser doesn't make a BLACK border. It makes a yellow border. I have
specified a black one earlier in the text. And now it can't switch back to
black, it seems.

Micha


  Reply With Quote
Old 06-16-2004, 08:31 PM   #4
Neal
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

On Wed, 16 Jun 2004 21:52:43 +0200, Michael Westphal
<> wrote:

> Hello folks,
>
>
> I'm a newby in webdesign and have a question:
>
> <a href="Bild0278.jpg"
> target="_blank">
> <img src="Bild0278.jpg" width="100"
> height="75" alt="Vorschau" border="1" bordercolor="black">
> </a>
>
> My browser doesn't make a black border round my picture.
>
> What is wrong?


"bordercolor" on img makes no sense. The way to do this properly is using
CSS.

If you use an external stylesheet, it would read:

img.special {border: 3px black solid;}

Or, you can put it in your document's head:

<style>
img.special {border: 3px black solid;}
</style>

In either case the HTML is:

<img src="..." width="100" height="75" alt="Vorschau" class="special">

Or, you can add it to the tag itself.

<img src="..." width="100" height="75" alt="Vorschau" style="border: 3px
black solid;">

External is preferred, head next, in the tag last, as it's easier to
change thesite's style when the styles are all in one place.
  Reply With Quote
Old 06-16-2004, 09:15 PM   #5
Michael Westphal
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

Hi Neal,

You are great!

Many thanks!

best wishes!

Micha

--
Wer sich zu wichtig hält für kleine Arbeiten
ist oft zu klein für wichtige Arbeiten.

(Jaques Tati)
"Neal" <> schrieb im Newsbeitrag
news...
> On Wed, 16 Jun 2004 21:52:43 +0200, Michael Westphal
> <> wrote:
>
> > Hello folks,
> >
> >
> > I'm a newby in webdesign and have a question:
> >
> > <a href="Bild0278.jpg"
> > target="_blank">
> > <img src="Bild0278.jpg" width="100"
> > height="75" alt="Vorschau" border="1" bordercolor="black">
> > </a>
> >
> > My browser doesn't make a black border round my picture.
> >
> > What is wrong?

>
> "bordercolor" on img makes no sense. The way to do this properly is using
> CSS.
>
> If you use an external stylesheet, it would read:
>
> img.special {border: 3px black solid;}
>
> Or, you can put it in your document's head:
>
> <style>
> img.special {border: 3px black solid;}
> </style>
>
> In either case the HTML is:
>
> <img src="..." width="100" height="75" alt="Vorschau" class="special">
>
> Or, you can add it to the tag itself.
>
> <img src="..." width="100" height="75" alt="Vorschau" style="border: 3px
> black solid;">
>
> External is preferred, head next, in the tag last, as it's easier to
> change thesite's style when the styles are all in one place.



  Reply With Quote
Old 06-16-2004, 09:59 PM   #6
Jukka K. Korpela
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

"Michael Westphal" <> wrote:

> <a href="Bild0278.jpg"
> target="_blank">
> <img src="Bild0278.jpg"
> width="100"
> height="75" alt="Vorschau" border="1" bordercolor="black">
> </a>
>
> My browser doesn't make a black border round my picture.
>
> What is wrong?


Quite a lot. To start with, you are using the width and height attributes
to shrink the image. This is absurd, since the browser needs to load the
image and then scale it. Use image processing software to create a real
thumbnail, i.e. a reduced-size version of the image.

Don't use the target attribute until you know what it really means.
(And when you know that, you won't use it, except in rare special
occasions.)

You don't need the border and bordercolor attributes. The browser
automatically puts a border around an image that is a link, using link
colors. Think twice before changing link colors and related issues from
the browser defaults, and then reject the idea. (OK, OK, for images there
might be special considerations.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


  Reply With Quote
Old 06-17-2004, 05:35 AM   #7
Neal
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

On Wed, 16 Jun 2004 23:15:47 +0200, Michael Westphal
<> wrote:

> Hi Neal,
>
> You are great!
>
> Many thanks!
>
> best wishes!
>
> Micha
>



Check out http://www.w3schools.com/css/default.asp for more...
  Reply With Quote
Old 06-17-2004, 05:58 AM   #8
Leif K-Brooks
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

Jukka K. Korpela wrote:
> "Michael Westphal" <> wrote:
>> <img src="Bild0278.jpg"
>> width="100"
>>height="75" alt="Vorschau" border="1" bordercolor="black">

> To start with, you are using the width and height attributes
> to shrink the image.


How do you know? I don't see a URL listed anywhere.
  Reply With Quote
Old 06-17-2004, 06:14 AM   #9
Jukka K. Korpela
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

Leif K-Brooks <> wrote:

> Jukka K. Korpela wrote:
>> "Michael Westphal" <> wrote:
>>> <img src="Bild0278.jpg"
>>> width="100" height="75" alt="Vorschau"
>>> border="1" bordercolor="black">

>> To start with, you are using the width and height attributes to
>> shrink the image.

>
> How do you know? I don't see a URL listed anywhere.


The <a> markup around the <img> element points to the same URL as the
<img> element, i.e. the image is a link to itself. This hardly makes any
sense for a 100 by 75 pixels image, so my crystal ball is pretty sure
about the conclusion. (And the alt attribute value means 'preview', which
is hardly useful to people who do not see the image but tells about the
author's intention of using a thumbnail.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


  Reply With Quote
Old 06-17-2004, 02:37 PM   #10
Michael Westphal
 
Posts: n/a
Default Re: img scr tag: how to specify the border color?

Hello Jukka,

Yes, I've already noticed this yesterday as I checked my work on the server
in the web.
It took quite long to show the "thumbnails".

The target attribute was in that text I cut from an example. You are right,
I don't know the purpose.

Thx,

Micha


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump