SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Nov 2008
    Posts
    201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems With Margins On Divs...

    Please check this page: http://retrocitysunglasses.com/newblank3.html

    The first cell inside the table of div "headerlogo" is 65px. In my style sheet, I do not specify a height of 65px for that cell. The extra 5px of spacing creating uneven spacing between the top and the bottom of the entire "headerlogo" div. Why?

    Also, there is supposed to be a 10px margin at the bottom of the "headernav" div but it looks like 25px instead... why?

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Hi, it's because images are inline elements and leave room for some text descendants. Set images' vertical align
    [code]img{vertical-align:bottom;}

    The next issue is caused by the <h1> inside "#contentmain". It's pushing the margin throuigh the parent and thus a margin collapse. You can give "#contentmain" a 1px top padding or border to fix this (or get rid of hte <h1>'s margins

    You might want to look into a reset
    Code:
    *{margin:0;padding:0;}
    Or Eric Meyers
    http://meyerweb.com/eric/thoughts/20...eset-reloaded/
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    SitePoint Addict
    Join Date
    Nov 2008
    Posts
    201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, thank you!

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You're welcome
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  5. #5
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    […]
    You might want to look into a reset
    Code:
    *{margin:0;padding:0;}
    Or Eric Meyers
    http://meyerweb.com/eric/thoughts/20...eset-reloaded/
    Please, Ryan, do not recommend this foolish move. See this argument and this follow-up for why css reset considered harmful. (Sorry, Hixie, I couldn't resist stealing your silly phrase.) In addition to my own arguments, consider Stomme poes's comments on the harm done to forms by using
    Code:
    * {margin: 0;  padding: 0;}
    . I'll leave it to you to search out her comments.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  6. #6
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I realize the pitfalls of doing that, however there are no forms on that site (I know that it could be added)

    I gave the OP multiple options and if hte OP isn't well informed enough to know how to cohose resets then let the question be asked here
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


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
  •