Results 1 to 6 of 6

Thread: css padding?

  1. #1
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default css padding?

    On this site I am updating, in the white content section of the page, the text goes all the way to the left and right edges. What am I doing wrong?
    This is the part of the CSS I am talking about.
    Code:
    #content {
        clear:both;
        position:relative;
        padding:1.5em 5%;
     }

    FULL CSS:
    Code:
    html, body {
        margin:0;
        background-image:url(images/greekkey.gif);
        font-family:'Open Sans',sans-serif;
        font-size:100%;
        color:#036;
     }
    ul {
        padding:0;
        margin:0;
        list-style-type:none;
     }
    a {
        text-decoration:underline;
     }
    #container {
        width:90%;
        margin:auto;
        background-color:#fff;    
     }
    #logo {
        display:block;
        width:100%;
     }
    
    #content {
        clear:both;
        position:relative;
        padding:1.5em 5%;
     }
    
    h1 {
        clear:both;
        text-align:center;
     }
    h2 {
        clear:both;
        text-align:center;
     }
    
    
    
    .innerBox {
      background-color : #ffffff;
      background-repeat : repeat-y;
      padding-top: 1em;
      padding-left: 1em;
      padding-right: 1em;
      padding-bottom : 1em;
    }
    #img-ctr {
        text-align: center;
    }
    #left {
        float: left;
        width: 32%;
        padding:5px;
    }
    
    #middle { 
        float: left;
        width: 32%;
        padding:5px;
    }
    
    #right {
        float:left;
        width:32%;
        padding:5px;
    }
    
    .columns {
        width:100%;
    }
    .left{
        float:left;
        width:45%;    
     }
    .right {
        margin-left:45%;
     }
    .clear {
        clear:both;
     }
    .google-maps {
        position: relative;
        padding-bottom: 75%; // This is the aspect ratio
        height: 0;
        overflow: hidden;
    }
    .google-maps iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
    }
    #social {
        margin:auto;
        text-align:center;
    }
    #map {
        height: 100%;
     }
    #brothers {
        margin:auto;
        text-align:center;
    }
    #footer {
        background:#7DA3E4;
        width:90%;
        margin:auto;
        text-align:center;
        font-family:sans-serif;
        font-size:80%;
        color:#fff;
        padding:0.5em 0;
     }
    #footer a {
        color:#fff;
        text-decoration:underline;
    }
    /* Smartphones (portrait and landscape) ----------- */
    @media only screen 
    and (min-device-width : 320px) 
    and (max-device-width : 480px) {
    /* Styles */
    }
    
    /* Smartphones (landscape) ----------- */
    @media only screen 
    and (min-width : 321px) {
    /* Styles */
    }
    
    /* Smartphones (portrait) ----------- */
    @media only screen 
    and (max-width : 320px) {
    /* Styles */
    }
    
    /* iPads (portrait and landscape) ----------- */
    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) {
    /* Styles */
    }
    
    /* iPads (landscape) ----------- */
    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    and (orientation : landscape) {
    /* Styles */
    }
    
    /* iPads (portrait) ----------- */
    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    and (orientation : portrait) {
    /* Styles */
    }
    
    /* Desktops and laptops ----------- */
    @media only screen 
    and (min-width : 1224px) {
    /* Styles */
    }
    
    /* Large screens ----------- */
    @media only screen 
    and (min-width : 1824px) {
    /* Styles */
    }
    
    /* iPhone 4 ----------- */
    @media
    only screen and (-webkit-min-device-pixel-ratio : 1.5),
    only screen and (min-device-pixel-ratio : 1.5) {
    /* Styles */
    }

  2. #2
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    this is how it looks now
    Click image for larger version. 

Name:	Capture.JPG 
Views:	149 
Size:	12.5 KB 
ID:	5548

  3. #3
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    This something like this instead;
    Code:
    #content {
        clear:both;
        position:relative;
        padding:1.5em 0;
        width:90%;
        margin:auto;
     }
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  4. #4
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    Beverly that didn't work. I just uploaded the new style css and it looks the same. Yes, I refreshed the cache and the css cache too

  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I just took another look and "content" is a class rather than an id, so use ".content" instead of "#content" in your CSS
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. #6
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    Wow, I can't believe that I overlooked that. Thank you so much.

Similar Threads

  1. padding:initial vs. padding:0
    By Rain Lover in forum CSS
    Replies: 1
    Last Post: 07-17-2014, 11:07 PM
  2. Resolved padding issue
    By mlegg in forum CSS
    Replies: 1
    Last Post: 07-01-2011, 01:17 AM
  3. where is this padding coming from ?
    By yung23 in forum HTML
    Replies: 4
    Last Post: 07-16-2010, 07:38 PM
  4. Resolved Padding list
    By saynogo9999 in forum Looking for such a script or service
    Replies: 13
    Last Post: 01-05-2009, 01:50 PM
  5. Replies: 4
    Last Post: 10-28-2005, 07:05 PM

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
  •