img scr tag: how to specify the border color?

M

Michael Westphal

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
 
M

Michael Westphal

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
 
N

Neal

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.
 
J

Jukka K. Korpela

Michael Westphal said:
<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.)
 
J

Jukka K. Korpela

Leif K-Brooks said:
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.)
 
M

Michael Westphal

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
 
N

Neal

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.)

Incredible, Holmes!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top