SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    UK
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is this good CSS or can it be improved upon? (Borders)

    Code:
    .top {
     width: 700px;
     border-style: solid;
     border-color: #000;
     border-width: 0px 1px 1px 0px;
    }
    .main {
     width: 700px;
     border-style: solid;
     border-color: #000;
     border-width: 0px 1px 1px 0px;
    }
    The widths are in pixels due to me having a 700px wide image as the banner...not much I can do about that.

    It's set so there's no top or left border on the <div>'s that use those classes.

    Also, the #000, I know I can put either black, #000000, or #000 but what is the real best way? I just put #000 because it's shorter . Should I put black because it looks better or is it better to put hexadecimals in?

    I was just unsure about how 'good' the border-style, border-color and border-width CSS code was. Please let me know if anything is bad and should be changed.

    Note: It validates on the CSS validator at w3.org.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    They're all good. Nice use of the separate border properties too. I've seen way too much of this:
    Code:
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    border-left: 1px solid black;
    border-right: none;
    Your method is much cleaner and it's the one I use when I don't need all sides to have the same border.

  3. #3
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    UK
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah good, glad to see I'm on the right track. So far so good, I'm constantly refreshing the XHTML and CSS validators over at w3.org as I update my page, just to make sure I'm all valid .


Bookmarks

Posting Permissions

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