<HR> Styling

This is a discussion on "<HR> Styling" within the Web Page Design section. This forum, and the thread "<HR> Styling are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 31st, 2007, 12:23
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
<HR> Styling

Hi All,

I want to style my hr's in css, but i don't know how to go about it, help please!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 31st, 2007, 12:28
Resources Team
Join Date: Jun 2007
Location: UK
Posts: 453
Thanks: 1
Thanked 4 Times in 4 Posts
Re: <HR> Styling

hr {
border: 0;
width: 80%;

}

Thats the basic HR in css hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 31st, 2007, 12:44
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

You can also thicken it with a border, or add colour. That's the beauty of CSS.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 31st, 2007, 14:16
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

with the css style will it just work everytime i use the tag <hr> ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 31st, 2007, 14:20
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

http://www.hixie.ch/tests/evil/mixed/hrbrstyles.html

or

http://www.sovavsiti.cz/css/hr.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 31st, 2007, 14:22
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

It should do, unless you apply specific styling to it in isolation. Remember, the C of CSS means CASCADING, so the style cascades through your page(s) applying the same attributes, unless altered (say, with an in-line style specific to that entity).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jul 31st, 2007, 14:26
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

Quote:
Originally Posted by RZX Developer View Post
with the css style will it just work everytime i use the tag <hr> ?
Yes ... when you code your css like this

Quote:
Originally Posted by crackafaza View Post
hr {
border: 0;
width: 80%;

}
this applies to every hr element you use in your document.

Same thing as if you were doing

Code: Select all
h1 {
   color: #900;
}
and so on
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 31st, 2007, 14:42
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

the css style works perfect in IE7 but not in FireFox

CSS

hr {
border: 0;
width: 100%;
color: #fff000;
height: 2px;
}

XHTML

<hr />
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jul 31st, 2007, 14:55
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

See Mike's 2nd link for explanation on which browser supports which properties.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jul 31st, 2007, 15:00
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

Thanks for the advise
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jul 31st, 2007, 15:01
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

This is the styling for a HR on one of my sites, and it renders perfectly in FF:
Code: Select all
hr {margin:15px auto; width:150px; background-color:#986; height:2px;}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jul 31st, 2007, 15:03
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

cheers, it was background-color for it to work in FF instead of color att.

Cheerz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jul 31st, 2007, 15:47
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

You shouldn't be using horizontal rules at all, in my opinion. You need to separate content/structure from presentation. Just use pure css for this.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jul 31st, 2007, 15:53
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

Thanks for the advise Pete, but I am using the <hr /> as it is for around my Nav Menu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jul 31st, 2007, 15:57
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

Why not give the ul a bottom or top border, depending on where you want it. I'm sure this would be very simple to achieve without any presentational mark-up.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jul 31st, 2007, 16:03
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 172
Thanks: 0
Thanked 1 Time in 1 Post
Re: <HR> Styling

I didnt thnk of tht, thanks Pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Jul 31st, 2007, 21:12
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

Quote:
Originally Posted by pa007 View Post
You shouldn't be using horizontal rules at all, in my opinion. You need to separate content/structure from presentation. Just use pure css for this.
<hr> is not entirely presentational: it indicates a separator or divider.

In fact, a case could easily be made that <hr> is "more semantic" than (say) using a CSS border in its place!

Personally I never use this element, but I don't see its use as wrong. Convention generates meaning; more on this in a later article.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Jul 31st, 2007, 22:10
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

I agree that it could be viewed that way but I believe in not using these things just because they have come to mean something and instead sticking to strict principles in some vain attempt at cleaning up the mess.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Jul 31st, 2007, 22:15
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: <HR> Styling

Quote:
Originally Posted by pa007 View Post
I agree that it could be viewed that way but I believe in not using these things just because they have come to mean something and instead sticking to strict principles in some vain attempt at cleaning up the mess.
<hr>'s conventional meaning goes back long, long before the invention of the worldwide web. It's regularly used in print documents, in some form or other.

Ever see * or * * * (or various other glyphs) used as a separator in a book? It's just a fancy <hr>.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
hr styling

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with styling my blog please alexgeek Website Planning 12 Sep 23rd, 2007 01:25
CSS border styling RZX Developer Web P