HighDots Forums  

Background Padding not working

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Background Padding not working in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shapper
 
Posts: n/a

Default Background Padding not working - 02-29-2008 , 06:02 PM






Hello,

I am applying a background to my table header.
I want the background to be applied to each table cell but having a
padding of 1px.
So, in each header cell the background will have a white line around
it not touching the border.

How can I do this?

I have the following but it is not working:

..Grid thead th
{
background: url(Images/GridHeaderBackground.jpg) repeat-x;
padding: 4px;
text-align: left;
}

Thank You,
Miguel

Reply With Quote
  #2  
Old   
Johannes Koch
 
Posts: n/a

Default Re: Background Padding not working - 03-01-2008 , 02:23 AM






shapper schrieb:
Quote:
I am applying a background to my table header.
I want the background to be applied to each table cell but having a
padding of 1px.
So, in each header cell the background will have a white line around
it not touching the border.
table {
border-collapse: collapse;
}
?

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #3  
Old   
Ben C
 
Posts: n/a

Default Re: Background Padding not working - 03-01-2008 , 10:09 AM



On 2008-03-01, shapper <mdmoura (AT) gmail (DOT) com> wrote:
Quote:
Hello,

I am applying a background to my table header.
I want the background to be applied to each table cell but having a
padding of 1px.
So, in each header cell the background will have a white line around
it not touching the border.

How can I do this?
You can't. The background image goes right up to the border, that's just
the way it's defined.

You could edit the image to put a 1px white line at the bottom. Then
inside the <th> nest a div with 1px top left and right white borders.

This will work since your image is only repeat-x and not -y. But it
illustrates another problem which is that you don't know the height the
th is going to be (it depends on the user's font). But perhaps you don't
mind a bigger gap or no gap below the image.

Quote:
I have the following but it is not working:

.Grid thead th { background: url(Images/GridHeaderBackground.jpg)
repeat-x; padding: 4px; text-align: left; }

Thank You, Miguel

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.