hr styling or image divider?

  • Chaz1978
  • Born
  • Born
  • Chaz1978
  • Posts: 2

Post 3+ Months Ago

Hi

First post and first question. I'm building a tableless css site and need a divider between some paragraphs on the main body of text. i'd rather not create a whole new span just for that with a bottom border so a hr tag of some kind would be best. but which is the way to go? a styled hr tag or a new div class with a bg repeating image??

if someone had the stylesheet script for the bg image it's be great! i'm bowing to your superior abilities at this point :D
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Well you can add a background image to an HR just as easily as to a div. Here are some great HR examples...

Background Image CSS code is:
Code: [ Select ]
background:color url(pathtoimage.jpg) repeat;
Where color is replaced with hex code and repeat can be repeat (tiled) repeat-x (horizontal) repeat-y (vertical)
  • Chaz1978
  • Born
  • Born
  • Chaz1978
  • Posts: 2

Post 3+ Months Ago

Thanks graphixboy, some great dividers there! will having a hr as opposed to a div create any cross browser problems? i'm new to css but read some places that it's a "rebel tag"??

so css code would be:

Code: [ Select ]
.content .hr{
background:color url(pathtoimage.jpg) repeat-x;}
  1. .content .hr{
  2. background:color url(pathtoimage.jpg) repeat-x;}


??

as for the color: would that need to be the same as my body bg or?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

I can't imagine any problems with an hr. They've pretty much been around for ever. Your css code is almost right you just need to dump the period before the hr. It should be
Code: [ Select ]
.content hr{
background:color url(pathtoimage.jpg) repeat-x;}
  1. .content hr{
  2. background:color url(pathtoimage.jpg) repeat-x;}


Color's up to you. If your using an opaque image it probably won't matter much. I'd go with the same color as what ever the hr sits on top of.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 61 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.