SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tables cell not sizeing with css

    I have created a graphic 125px big and made it the background in a table cell, works a treat in firefox but not in IE, it does work ok until I add test in the cell then gets about 20px bigger, here is the code

    HTML
    <td class="logo_cell" colspan="3"><h1>Web Site name</h1></td>

    CSS
    .logo_cell{
    background:#cc9908 url("../images/header.jpg"); background-repeat: no-repeat;
    height:125px;
    padding:15px;
    }

    so thats seems simple enough I thought, if I change the height to 95px then it looks ok, it also views ok until I add text.
    Anyone have any ideas why.

    Cheers Ian

  2. #2
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    London
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add this to the css for the table:

    table-layout: fixed

  3. #3
    Non-Member lostseed's Avatar
    Join Date
    Sep 2005
    Location
    Zurconion Soon!
    Posts
    1,549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im not sure if the validator approves of underscores for names.

    To make it easier, just apply <table class="logo-cell"> and you wont have to put the class in each individual td tag.

    Code:
    td.logo-cell{
    background:#cc9908 url("../images/header.jpg") no-repeat; 
    height:125px;
    padding:15px;
    }
    You can put the no-repeat afterwards, it has to go in that order if you
    use background.

    background: [1]color [2]url [3]repeat

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add this to the css for the table:

    table-layout: fixed
    Tried this and the whole page went wrong, I just cant work out what makes the cell to big so that the background graphic wants to start repeating,

    What a nightmare, here's a link seeing it will show my problem
    Last edited by meanweaver; Jun 17, 2006 at 13:13.

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    uk colchester
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im not sure if the validator approves of underscores for names
    I missed this line when reading the posts earlier, anyway changed the _ to - and it now works a treat, Have left just this cell with that class as it's the only one this rule needs to apply to.

    Thanks again the for the help.

    Regards

    Ian


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
  •