468,119 Members | 1,722 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Problem with the <hr /> - Tag in XHTML

Hi everyone,

I have a problem with the <hr /> - TAG. My aim is to produce a thin line
with 1px height. That's no problem, with CSS it is working well.
width: 170px;
height: 1px;
overflow: hidden;
border: solid 0px #D4E061;
background: #D4E061;
color: #D4E061;
line-height: 1px;
font-size: 1px;

padding: 0px;
margin: 0px;

The probem I have is that the padding/margin thing is not working in the
IE there is always too much space over or under the line.

Is there a possibility to disable this behaviour?
Greetings from Matthias
Jan 19 '06 #1
4 4458
Tim
On Thu, 19 Jan 2006 09:33:02 +0100, Matthias Göbels sent:
padding: 0px;
margin: 0px;

The probem I have is that the padding/margin thing is not working in the
IE there is always too much space over or under the line.


Your issue is probably due to the styling of the other elements adjacent
to the HR. We don't have enough information about your problem page to
diagnose.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

Jan 19 '06 #2
Matthias Göbels <fr****@frixxx.de.nospam> wrote:
I have a problem with the <hr /> - TAG.
There are very few situations where usage of <hr> markup is justified,
most often it is used in a presentational manner. Presentation is the
task of CSS, not markup.
My aim is to produce a thin line
with 1px height.
Then don't use <hr>, set a top or bottom border on the adjacent block
level element.
padding: 0px;
margin: 0px;

The probem I have is that the padding/margin thing is not working in the
IE there is always too much space over or under the line.


IE only allows limited styling of the <hr> element, there's nothing that
you can do about it.

--
Spartanicus
Jan 19 '06 #3
Matthias Göbels wrote:

I have a problem with the <hr /> - TAG. My aim is to produce a thin line
with 1px height. That's no problem, with CSS it is working well.
You'd probably do better using a 1px top or bottom border instead of hr.
IE there is always too much space over or under the line.


That's a side effect of IE's broken overflow behavior. Unless you set
overflow:hidden, it expands the height to minimum 1 line, per whatever
font it happens to be using.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jan 19 '06 #4
On Thu, 19 Jan 2006 13:03:52 GMT, Spartanicus <in*****@invalid.invalid>
wrote:
There are very few situations where usage of <hr> markup is justified,


Oh, use the bloody thing and stop worrying about it (search back to
November in c.i.w.a.s for a longer explanation of why).
<http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/browse_frm/thread/a13ca7b142c71469/defd2f3e1f2b2336?lnk=st&q=%3Chr+group%3Acomp.infos ystems.www.authoring.stylesheets+author%3Aandy+aut hor%3Adingley&rnum=1&hl=en#defd2f3e1f2b2336>

The web is broken. The world sucks. There isn't a clean split between
HTML and CSS. Get over it.

Jan 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Angelos | last post: by
34 posts views Thread by Mark Moore | last post: by
2 posts views Thread by Jeremy Collins | last post: by
11 posts views Thread by Ted Mayett | last post: by
1 post views Thread by Matthias Göbels | last post: by
20 posts views Thread by AndyZa | last post: by
3 posts views Thread by balakrishnan.dinesh | last post: by
13 posts views Thread by Mich | last post: by
3 posts views Thread by ajay2552 | last post: by
13 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.