No longer a <hr> tag in IE8?

  • NickN
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 03, 2005
  • Posts: 17
  • Status: Offline

Post June 26th, 2009, 8:27 am

Hello

I've always been using a <hr> tag without a problem.
Since the release of IE8 it doesn't show anymore.
The problem doesn't occur in Mozilla Firefox.

Anyone had the same problem or knows a solution?

I'm using
Code: [ Download ] [ Select ]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and a CSS:

Code: [ Download ] [ Select ]
hr { color: #B4C0CF; background-color: #B4C0CF; border: 0px solid #B4C0CF; }


Thanks in advance.

Nick
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 26th, 2009, 8:27 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1597
  • Loc: Minneapolis, MN
  • Status: Offline

Post June 26th, 2009, 9:00 am

try <hr /> instead of <hr> technically xhtml requires a closed tag so the tag with the slash in it is actually short hand for <hr></hr> I don't know for sure that IE8 will like it since I didn't test but I'm pretty sure I've run into similar issues.

Oh and you need to add a height to your CSS for an HR to display in ANY version of IE.
//// Designer, Art Director, Developer & Teacher of Interactive, Motion and 3D \\\\
WhenImNotSleeping.com
  • NickN
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 03, 2005
  • Posts: 17
  • Status: Offline

Post June 26th, 2009, 9:13 am

I'm using <hr /> tags, so that isn't the problem.

I'll try adding the height.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 273
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post June 26th, 2009, 10:31 am

I gave up on the <hr /> tag a long time ago just use a div with a background and set it to tile along (x)
^__^
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7092
  • Loc: Ozzuland
  • Status: Offline

Post June 26th, 2009, 11:17 am

tastysite wrote:
I gave up on the <hr /> tag a long time ago just use a div with a background and set it to tile along (x)

Not a good idea. I don't know why, but my instincts say its a bad idea.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • webcosmo
  • Beginner
  • Beginner
  • User avatar
  • Joined: Mar 21, 2007
  • Posts: 37
  • Loc: Boston, USA
  • Status: Offline

Post June 26th, 2009, 11:48 am

Its working on my side.
You can use the div as suggested, I use it quite often.
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7092
  • Loc: Ozzuland
  • Status: Offline

Post June 26th, 2009, 11:52 am

webcosmo wrote:
Its working on my side.
You can use the div as suggested, I use it quite often.

I know you can do that, and I know it would work. I just don't think that is a good idea.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Mastermind
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2491
  • Loc: Nashville, TN
  • Status: Offline

Post June 26th, 2009, 11:54 am

I don't see any immediate reason for concern. I've used it myself quite a few times with a stretched background to achieve the same effect.
I'd love to change the world, but they won't give me the source code.
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11817
  • Loc: Clearwater, FL
  • Status: Offline

Post June 26th, 2009, 1:01 pm

I haven't used <hr/> in awhile. I generally have content that would need an <hr/> to separate it inside containers, and I just apply the visual separation of an <hr/> with that containers CSS.

I'm inclined to agree with bogey about jury-rigging something else for the sole purpose of working like something that already exists though.
Why yes, yes I am.
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7092
  • Loc: Ozzuland
  • Status: Offline

Post June 26th, 2009, 2:22 pm

joebert wrote:
I haven't used <hr/> in awhile. I generally have content that would need an <hr/> to separate it inside containers, and I just apply the visual separation of an <hr/> with that containers CSS.

That's what I do. I put the line within the div/element.

Like if you visit my site, you will see a yellow line after 'Welcome to Wedevoy!'.

That is accomplished like:

The HTML
Code: [ Download ] [ Select ]
<h1>Welcome to Wedevoy!</h1>
The CSS
Code: [ Download ] [ Select ]
h1 {
    color: #798030;
    padding-left: 25px;
    padding-bottom: 5px;
    border-bottom: 2px solid #C3CC4D;
}
  1. h1 {
  2.     color: #798030;
  3.     padding-left: 25px;
  4.     padding-bottom: 5px;
  5.     border-bottom: 2px solid #C3CC4D;
  6. }
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • NickN
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 03, 2005
  • Posts: 17
  • Status: Offline

Post June 26th, 2009, 2:54 pm

Found it!

Stupid actually. Since it works in Mozilla and not in IE8 it had to be the CSS-file:

Code: [ Download ] [ Select ]
1.hr { color: #B4C0CF; background-color: #B4C0CF; border: 0px solid #B4C0CF; }


--> the border had to be 1px minimum, though Mozilla showed it.

---------

Personally I think the <div> tag is easy and multifunctional, but it doesn't always pass the HTML validator of W3C. It's "better" to use the standard tags, and adjust them with CSS I think. But then you have to pay attention, so you don't get mistakes like these :-)
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7092
  • Loc: Ozzuland
  • Status: Offline

Post June 26th, 2009, 3:48 pm

tastysite wrote:
I gave up on the <hr /> tag a long time ago just use a div with a background and set it to tile along (x)

Also, one other reason not to do that... no reason to invent the wheel, and find a hack (or a fix) to something that already works.

Not need to fix something that isn't broken.

It's also easier to put <hr /> instead of <div></div> or <span></span>.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • mk27
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jun 09, 2009
  • Posts: 257
  • Status: Offline

Post June 27th, 2009, 10:28 am

Bogey wrote:
webcosmo wrote:
Its working on my side.
You can use the div as suggested, I use it quite often.

I know you can do that, and I know it would work. I just don't think that is a good idea.


I agree in the sense that if "deprecating" <hr> means having to get this silly just to get a horizontal rule in a page, that is "devolution". Nothing is improved by requiring more coding instead of less in such a simple case; I think the IE8 and WC3 people responsible should now have to spend their evenings and weekends "updating" all the pages on the net containing <hr> -- and never, ever be allowed any input into major software development again... :mrgreen:
Image
  • marksmithweb
  • Born
  • Born
  • No Avatar
  • Joined: Jul 05, 2009
  • Posts: 1
  • Status: Offline

Post July 5th, 2009, 2:49 am

But I still use <hr /> without any problems can u show your website so we can have a look?
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7092
  • Loc: Ozzuland
  • Status: Offline

Post July 5th, 2009, 7:13 pm

marksmithweb wrote:
But I still use <hr /> without any problems can u show your website so we can have a look?
I think he fixed his problem...
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 5th, 2009, 7:13 pm

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 87 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.