Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Feb 2005
    Location
    Nowhere.
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to change the attributes of a HR with CSS?

    I have the following sheet:
    Code:
    HR
    {
      color:white;
      width:100%;
      height:1px;
    }
    And the HR-s look again gray and huge. How to fix this?

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    is the HR assigned in your htmlk as <hr class="hr"> or have you written it some other way?

    If it were me I would do the html like this <hr class="hr"> and then in the css put

    .hr {
    color : #fff;
    width : 100%;
    height : 1px;
    }

    Bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Location
    mile high city
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's been another thread on this over the last day or so...

    hr colors issue

    This is a great place for answers. But many questions have been answered before. Don't forget to start with a forum search.
    Computer, kill Flanders... Did I hear my name? My ears are burning...
    Good start. Now finish the job.

  • #4
    New Coder
    Join Date
    Feb 2005
    Location
    Nowhere.
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thank you, I did it another way. But it worked with background-color instead of color.

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Quote Originally Posted by mcdougals4all
    There's been another thread on this over the last day or so...
    Ooops I should have remembered that, seeing as how it was my thread

    Bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #6
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, I did it another way. But it worked with background-color instead of color.
    Thank-you, I would have never known the attribute "horizontal rule" was considered a background in CSS. I wish they would have put that in the CSS and (X)HTML books.

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Quote Originally Posted by kickshuff View Post
    Thank-you, I would have never known the attribute "horizontal rule" was considered a background in CSS. I wish they would have put that in the CSS and (X)HTML books.
    It isn’t. A horizontal rule is an element (not an attribute) as any other element in HTML. Only there are different ways it’s rendered in different browsers. If you want to change the color of a horizontal rule, you have to set both, the color and background color CSS properties. Internet Explorer ignores the background color but applies the color instead while the other major browsers apply the background color and ignore the color property.

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    hr can take the color from border settings too. Have a look at this: http://nopeople.com/CSS/hr/index.html
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •