Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HD tag in CSS

Status
Not open for further replies.

SteveHigh

Technical User
Jan 17, 2007
158
GB
Hello

I am unsure about why my HD tag is not working; also, I wondered where to insert the ALT (image) tag.

Any help appreciated.

Thanks

Steve

<style type="text/css">
p
{
font: normal 11px verdana
}

HD
{
font: bold 13px verdana
}

BODY {background-image: url(passed_driving_test.jpg);
background-repeat: no-repeat;
background-position: 300px 100px;
background-attachment: fixed;}


</style>
 
HD isn't a valid tag. The alt information goes within the html img tag (not in css):
Code:
<img src="myimage.gif" alt="My alt information" />
See
Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hello

Many thanks for your replies.

When I insert:

<style type="text/css">

BODY {background-image: url(passed_driving_test.jpg);
background-repeat: no-repeat;
background-position: 300px 100px;
background-attachment: fixed;}

</style>

<body>
</body>
</html>

I get an image on my page (driving test image).

So what I need to do is insert:

<img src="passed_driving_test.jpg" alt="Passed!"/>

in the <body></body> tags and it should show me the ALY when I pass the mouse over it.

OK, that's fine. Thank you traingamer.

I think what I was trying to do with the HD tag (which you say is invalid) is show that where HD (or whatever the heading tags are) appears between the <body></body> tags, it would show as a certain font, and style and size, which differentiates it from the rest of the text.

But I will have a look on the more details about how to do it.

Thanks again.

Steve
 
Hi

Why the background ? Why not :
Code:
<html>
<head>
<title>Driving Test</title>
</head>
<body>
<h1>Driving Test</h1>
<img src="passed_driving_test.jpg" alt="Passed!"/>
</body>
</html>

Feherke.
 
it should show me the AL[T] when I pass the mouse over it.
The alt attribute of an <img> element is for authors to enter a text alternative for the benefit of those who cannot see the image for whatever reason. Only Internet Explorer displays the [tt]alt[/tt] text in a tooltip, if that's the behaviour you want, use the [tt]title[/tt] attribute instead:
Code:
<img src="somefile.gif" alt="text alternative" title="tooltip">

It is not possible to specify a text alternative or a tooltip for a background image. If you have an image that's important enough to warrant either of those things, it shouldn't be in the background - use an <img> instead.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top