1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

First attempt at a tableless layout = fail (somewhat)

Discussion in 'CSS' started by danzor, Mar 5, 2006.

  1. #1
    so, for the past 2 years or so ive been designing sites solely in tables, whilst using css for fonts etc.

    recently i decided to try porting one of my sites current layouts to a tableless layout.
    some of it works fine, it displayed fine in both firefox and ie7, but i am having some issues regarding stretching of boxes, and text alignment.

    the tableless layout can be found here. obviously, the navigation boxes stretch in a rather ugly manner. absolutely no idea how to fix this.
    secondly, i cant get the "Nav title" header things to display below the top of the box. i've tried padding-top, but when that is used, a space appears below the nav text div which is the same size as the padding-top value.

    sorry if this is a bit hard to follow :confused: any help appreciated.
     
    danzor, Mar 5, 2006 IP
  2. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    At a glance, I can see one issue right away. You're using paragraphs within those side boxes. There's nothing wrong with this, except by default, the <p> element has a top margin attached to it. This is why you're seeinga gap, because the margin on top of your paragraphs is pushing out the top of the containers in which they are housed.

    Try adding this to your style sheet:
    p { margin:0 ; padding:.8em 0 }

    See if you like that effect a little more :)
     
    the_pm, Mar 8, 2006 IP
    danzor likes this.
  3. danzor

    danzor Peon

    Messages:
    208
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks, much better.

    is there any way i can give the navtop class some padding without it creating a space below it?
     
    danzor, Mar 13, 2006 IP
  4. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm afraid I don't understand the question...there is no element on your page with class="navtop" ;)
     
    the_pm, Mar 14, 2006 IP
  5. danzor

    danzor Peon

    Messages:
    208
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    navboxtop. you can see the problem now as underneath 'Nav title' on both sides of the page, theres a small 2px gap below it, because i set padding-top to 2px.
     
    danzor, Mar 14, 2006 IP
  6. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't even need to check your source code to be able to tell what happening this time around :)

    I'm guessing you have an explicit height set for that element. When you add 2 pixels of padding, this adds two pixels to the height of the element automatically. So, you need to reduce the height of navboxtop by two pixels, and everything will be just fine.

    Just for kicks, I just checked your .css file, and it looks like setting height:21px will solve this problem.
     
    the_pm, Mar 14, 2006 IP
    Colleen likes this.
  7. danzor

    danzor Peon

    Messages:
    208
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks much. looks fine now!
     
    danzor, Mar 14, 2006 IP
  8. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Always happy to help :)
     
    the_pm, Mar 14, 2006 IP