SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: CellSpacing and CellPadding for CSS

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2012
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CellSpacing and CellPadding for CSS

    Hi,

    The current state of my website is over here - http://insurancecommissionrefund.com/dropdown/

    This is the state which I wanted to achieve - http://insurancecommissionrefund.com...05/changes.jpg

    Basically I wanted 2 things, the spacing between each td and alignment left together with the Navigation Menu and the Slide Show.

    CSS Codes for my table class
    Code:
    td.tableheader {
    vertical-align: top;
    background-color:#336666;
    }
    By setting:
    div#content .padder {
    padding-left: 0px;
    }

    I am able to shift the whole thing to align with the Menu and slideshow but it affects also the rest of the website, am I able to use this on the home page itself only? Any help rendered is greatly appreciated.

    Regards,
    Chris.

  2. #2
    Mouse catcher silver trophy
    SitePoint Award Recipient Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,107
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    If you want it to affect the home page only, and definitely no other pages ever, the easiest thing is to take that bit of CSS out of the stylesheet and put it directly into the page head in <style type="text/css">...</style> tags.
    Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
    Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes


  3. #3
    The CSS Clinic is open silver trophybronze trophy
    SitePoint Award Recipient Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    37,800
    Mentioned
    99 Post(s)
    Tagged
    3 Thread(s)
    HI,

    You already have a class called .home in the body tag so you could use that to target the home page only.

    e.g.

    Remove the padder class you added and just pull the table wide.

    Code:
    .padder{padding:20px}
    .home .entry table{
    margin:0 -20px 15px;
    width:auto;
    }
    .home .entry td.tableheader{border-left:5px solid #fff;}
    .home .entry td.tableheader:first-child{border:none}
    .home .entry td.tablecontent{padding-left:10px}

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
  •