Skip navigation
Currently Being Moderated

Site won't follow CSS rule, horizontal line colour.

Nov 11, 2010 1:11 AM

Hi,

 

I have made a CSS syle:-

 

.hr {
  border:0;
  border-top: 1px solid #840017;
  height: 0;
  background: #840017;

 

This makes a horizontal line to act as a break.  But in FF and IE it comes out grey and not claret (#840017)

 

Any ideas what I have done wrong?

 

page can be seen here

 

http://www.thevillagers.co.uk/matchreports/1011/chinnor15holyport.html

 

Thanks,

 

Richard

 
Replies
  • Currently Being Moderated
    Nov 11, 2010 1:25 AM   in reply to rjtyrell

    .hr {
      border:0;
      border-top: 1px solid #840017;
      height: 0;
      background: #840017;

     

    This makes a horizontal line to act as a break.

     

    Unfortunately not.

     

    You've inadvertently defined a class of "hr" (which has no effect on the <hr> tag), rather than re-defining the format of the <hr> tag (which is your intention).

     

    Remove the leading period (full stop) from in front of the hr in the stylesheet to change it from a class="hr" to a tag selector <hr>.

     

    Change

     

    .hr

     

    to

     

    hr

     

    A subtle but important difference.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points