SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    P Town
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New to css... Is this possible?

    I am trying to make a box with a border that only goes 90% of the way across a side of the box.

    For instance I would like a top border to not go all the way across the top but only 90% of the top.

    I hope that was not to confusing of a description.

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could make the box 90% of the desired width, with a 5% left and right margin?

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,530
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    You need to rub some of the line out to get that effect.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    #outer{
     width:50%;
     border:1px solid #000;
     position:relative;
     height:200px;
    }
    #border{
     background:#fff;
     height:1px;
     overflow:hidden;
     position:absolute;
     right:0;top:-1px;
     width:10%;
    }
    </style>
    </head>
    <body>
    <div id="outer">
      <div id="border"></div>
    </div>
    </body>
    </html>
    Paul


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
  •