Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > img scr tag: how to specify the border color?

Reply
Thread Tools

img scr tag: how to specify the border color?

 
 
Michael Westphal
Guest
Posts: n/a
 
      06-16-2004
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!


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      06-16-2004
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
 
 
 
 
Michael Westphal
Guest
Posts: n/a
 
      06-16-2004
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
 
Neal
Guest
Posts: n/a
 
      06-16-2004
On Wed, 16 Jun 2004 21:52:43 +0200, Michael Westphal
<(E-Mail Removed)> 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
 
Michael Westphal
Guest
Posts: n/a
 
      06-16-2004
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news(E-Mail Removed)...
> On Wed, 16 Jun 2004 21:52:43 +0200, Michael Westphal
> <(E-Mail Removed)> 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
 
Jukka K. Korpela
Guest
Posts: n/a
 
      06-16-2004
"Michael Westphal" <(E-Mail Removed)> 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
 
Neal
Guest
Posts: n/a
 
      06-17-2004
On Wed, 16 Jun 2004 23:15:47 +0200, Michael Westphal
<(E-Mail Removed)> 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
 
Leif K-Brooks
Guest
Posts: n/a
 
      06-17-2004
Jukka K. Korpela wrote:
> "Michael Westphal" <(E-Mail Removed)> 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
 
Jukka K. Korpela
Guest
Posts: n/a
 
      06-17-2004
Leif K-Brooks <(E-Mail Removed)> wrote:

> Jukka K. Korpela wrote:
>> "Michael Westphal" <(E-Mail Removed)> 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
 
Michael Westphal
Guest
Posts: n/a
 
      06-17-2004
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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE8 img scr="" displays a red X christy ASP .Net 3 07-27-2009 01:07 PM
Problem: <img></img> Philipp Lenssen XML 15 07-03-2005 09:23 AM
how to download img from html img tag news.austin.rr.com ASP .Net 2 04-27-2005 06:25 PM
<img> tag and resource files for scr-source? Ole Hanson ASP .Net Building Controls 3 01-12-2005 01:20 PM
Adjusting the SCR Property in the IMG html tag news.verizon.net HTML 3 06-21-2004 05:09 PM



Advertisments