SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1-pixel border without css? possible?

    Using Dreamweaver, I can get a 1 pixel border for a table using CSS. However, I would like to have a table w/ a 1-pixel border only on the right side. I can achieve this with css, but I was wondering if it were possible to do this without using css? Or, if there is a better way to use css; right now if I want a pixel border on a certain side of the table, I make a css file for that side, hence for every side I want a 1 pixel border ONLY , I have to make a new css file for that side.

    Thanks for any help, and sorry if it was a little bit confusing.

  2. #2
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With CSS, you only need to have one file to do everything. If you want a bunch of tables to have a 1px border on the right, simply do something like this:
    Code:
    .1pxright { border-right: 1px solid #000000; }
    Then, on any table that you want to have that border, assign it that class:
    Code:
    <table class="1pxright"> ... </table>
    You should rarely need more than one CSS file.
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  3. #3
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i understand you correctly, you make a CSS file for each individual style ? no need for that, a single CSS file can contain all your styles. simply define different styles for the different borders, and use them like adam suggests...

    e.g.
    Code:
    1pxright { border-right: 1px solid #000000; }
    1pxleft {border-left: 1px solid #000000; }
    1pxtop {border-top: 1px solid #000000; }
    1pxbottom {border-bottom: 1px solid #000000; }
    1pxsolid {border: 1px solid #000000; }
    and then assign the class to the tables depending where you want the border:
    Code:
    <table class="1pxright">
    ...
    </table>
    <table class="1pxsolid">
    ...
    </table>
    etc etc
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    great. thanks guys

  5. #5
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OT

    Originally posted by Adam P.
    You should rarely need more than one CSS file.
    hehe, the last "large" website I did had about 9 of them

    Douglas
    Hello World


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
  •