"Charax" <ch******@ameritech.net> wrote:
Is it possible to use CSS to define <hr> as a graphic image?
Strictly speaking not, since you cannot add image content using CSS,
but you can specify a background image.
I have a 300 px graphic I'd like to continue using, without a
manual search and replace of <hr> on 300 web pages....
I wonder what you have been using (in terms of HTML and CSS, i.e. what
FrontPage has inserted for you), but the following would seem
reasonable:
hr { display: block;
width: 300px;
height: 10px;
background: url(deco.gif); }
Replace 10px by the height of your image.
This however leaves a border around the image on IE. I don't know why -
and setting border: none doesn't remove it.
This reminded me of Alan Flavell's "CSS1 and the Decorative HR",
http://ppewww.ph.gla.ac.uk/~flavell/www/hrstyle.html
which explains how complicated the issue is.
Personally I think using something like
<div><img alt="End of section." src="deco.gif"></div>
is a feasible alternative to using <hr> and then trying to style it
into an image. After all, <hr> itself is at least half-presentational,
and we generally use <img> to add purely decorative images. (Writing
adequate alt attributes is more important than being theoretically
puristic about not using "presentational tags".)
--
Yucca,
http://www.cs.tut.fi/~jkorpela/