SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Only Border Adds Width

    Bloody hell. I have designed a webpage which I am quite pleased with however I want to centre some text but I need to put something on the right. So I have put a space on the left. However the spacer will only add the width of 30% if an border is applied.

    Does anyone know how I can apply the 30% width without having a border.

    #headerlinksspacer{
    float:left;
    width:30%;
    clear:both;
    border-bottom:1px solid #989898;
    }

    #headerlinks{
    float:left;
    width:40%;
    text-align: center;
    font-family:Verdana, Geneva, sans-serif;
    font-size:.9em;
    color: #6E076B;
    padding-top: 3px;
    }

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,882
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    I'm guessing that at the moment you've got
    <div id="headerlinksspacer"></div>?

    If so, try putting a &nbsp; in there and see if that does the trick.

    Or alternatively, a better solution might be to have the right-hand content come first in the markup (floated right), and then you can float the headerlinks <div> to the right and you won't need a spacer <div> at all.

  3. #3
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Nice one thanks, that worked fine.

  4. #4
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    min-height:.5em; ( in IE height:.5em) that way you dont have to touch the mark up.


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
  •