<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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 31st, 2007, 12:23
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
<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!
Reply With Quote

  #2 (permalink)  
Old Jul 31st, 2007, 12:28
crackafaza's Avatar
Resources Team
Join Date: Jun 2007
Location: UK
Posts: 453
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to crackafaza
Re: <HR> Styling

hr {
border: 0;
width: 80%;

}

Thats the basic HR in css hope that helps.
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
Old Jul 31st, 2007, 14:16
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: <HR> Styling

with the css style will it just work everytime i use the tag <hr> ?
Reply With Quote
  #5 (permalink)  
Old Jul 31st, 2007, 14:20
SuperMember

SuperMember
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
Reply With Quote
  #6 (permalink)  
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).
Reply With Quote
  #7 (permalink)  
Old Jul 31st, 2007, 14:26
karinne's Avatar
SuperMember

SuperMember
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
Reply With Quote
  #8 (permalink)  
Old Jul 31st, 2007, 14:42
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
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 />
Reply With Quote
  #9 (permalink)  
Old Jul 31st, 2007, 14:55
karinne's Avatar
SuperMember

SuperMember
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.
Reply With Quote
  #10 (permalink)  
Old Jul 31st, 2007, 15:00
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: <HR> Styling

Thanks for the advise
Reply With Quote
  #11 (permalink)  
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;}
Reply With Quote
  #12 (permalink)  
Old Jul 31st, 2007, 15:03
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: <HR> Styling

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

Cheerz
Reply With Quote
  #13 (permalink)  
Old Jul 31st, 2007, 15:47
SuperMember

SuperMember
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.
Reply With Quote
  #14 (permalink)  
Old Jul 31st, 2007, 15:53
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: <HR> Styling

Thanks for the advise Pete, but I am using the <hr /> as it is for around my Nav Menu
Reply With Quote
  #15 (permalink)  
Old Jul 31st, 2007, 15:57
SuperMember

SuperMember
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.
Reply With Quote
  #16 (permalink)  
Old Jul 31st, 2007, 16:03
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: <HR> Styling

I didnt thnk of tht, thanks Pete
Reply With Quote
  #17 (permalink)  
Old Jul 31st, 2007, 21:12
SuperMember

SuperMember
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.
Reply With Quote
  #18 (permalink)  
Old Jul 31st, 2007, 22:10
SuperMember

SuperMember
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.
Reply With Quote
  #19 (permalink)  
Old Jul 31st, 2007, 22:15
SuperMember

SuperMember
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>.
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 Page Design 6 Aug 10th, 2007 14:25
RSS Styling question Daniel Other Programming Languages 4 Apr 8th, 2007 00:28
Styling the <h1> tag. minute44 Web Page Design 10 Aug 14th, 2006 10:12
Styling up with CSS gwx03 Webforumz Suggestions and Feedback 10 Oct 14th, 2003 20:21


All times are GMT. The time now is 07:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43