SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cell only 4 pixels high, can't add border?

    I have a table cell that is only 4 pixels high, but css won't allow me to add a bottom border to it. Why. When I preview it, the cell looks like it may have lost 1 pixel in height (which is understandable), but the different color bottom border doesn't show up. Is this a flaw in css or are there limits to when borders can be applied?

    Here is some code

    .top {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CC6600;
    }


    <td height="4" bgcolor="FFCC66" class="top"></td>

    Thanks
    Bryan

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most browsers won't draw the cell unless it has content (say &nbsp but that is going to make the height more than 4px, so give this a try and see what happens:

    Code:
    .top {
    font-size: 1px;
    line-height: 1px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CC6600;
    }
    
    <td height="4" bgcolor="FFCC66" class="top">&nbsp;</td>
    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
  •