![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I want to put a simple padding on the right hand side of my text container to stop the text from overflowing out of the box. Ive added a padding-right rule and it refusing to recognise it in either IE or Firefox. Ive done exactly the same with the left padding and thats worked fine. Whats the crack??? http://www.ainewmedia.co.uk/css_page.htm #bodyContent { font-family:Verdana, Arial, Helvetica, sans-serif; background-image: url(images/body_side_bg.png); background-repeat: repeat-y; padding-top: 10px; padding-left: 15px; padding-right: 10px; width: 750px; font-size: 12px; line-height: 20px; } |
#4
| |||
| |||
|
|
john_aspinall (AT) yahoo (DOT) co.uk wrote: I want to put a simple padding on the right hand side of my text container to stop the text from overflowing out of the box. Ive added a padding-right rule and it refusing to recognise it in either IE or Firefox. Ive done exactly the same with the left padding and thats worked fine. Whats the crack??? http://www.ainewmedia.co.uk/css_page.htm #bodyContent { font-family:Verdana, Arial, Helvetica, sans-serif; background-image: url(images/body_side_bg.png); background-repeat: repeat-y; padding-top: 10px; padding-left: 15px; padding-right: 10px; width: 750px; font-size: 12px; line-height: 20px; } Your padding is there. Add border: thin solid red; above and you'll see the extent of the DIV that lies inside the border, *including* the padding. The width of the bodyContent DIV is 750px, and the text fills that width, which is evidently also about the width of the rectangle in the background image. The right padding is to the right of that. Padding isn't part of the width, it's in addition to the width. Change the width to 730px and see what happens. |
#5
| |||
| |||
|
|
Harlan Messinger wrote: john_aspinall (AT) yahoo (DOT) co.uk wrote: I want to put a simple padding on the right hand side of my text container to stop the text from overflowing out of the box. Ive added a padding-right rule and it refusing to recognise it in either IE or Firefox. Ive done exactly the same with the left padding and thats worked fine. Whats the crack??? http://www.ainewmedia.co.uk/css_page.htm #bodyContent { font-family:Verdana, Arial, Helvetica, sans-serif; background-image: url(images/body_side_bg.png); background-repeat: repeat-y; padding-top: 10px; padding-left: 15px; padding-right: 10px; width: 750px; font-size: 12px; line-height: 20px; } Your padding is there. Add border: thin solid red; above and you'll see the extent of the DIV that lies inside the border, *including* the padding. The width of the bodyContent DIV is 750px, and the text fills that width, which is evidently also about the width of the rectangle in the background image. The right padding is to the right of that. Padding isn't part of the width, it's in addition to the width. Change the width to 730px and see what happens. Ahh right, so if your setting 10px right padding to a 750px width block, the padding lives outside of the block, therefore making its total widith 760px? I thought padding lived within the content. |
#6
| |||
| |||
|
|
Adding those ZZZ may cause the whole thing to fail. |
#7
| |||
| |||
|
|
Whether it works or not would be up to the browser. My understanding is that browsers have the option to ignore, or disregard, some or any or all parts of CSS if there is an error. Depends on the browser, I suppose. |
#8
| |||
| |||
|
|
I was pointing out that your post said to "comment out" then added ZZZ to the attribute. A legal comment mark in CSS is to surround the desired part with /* and */ |
|
Whether it works or not would be up to the browser. My understanding is that browsers have the option to ignore, or disregard, some or any or all parts of CSS if there is an error. |
#9
| |||
| |||
|
|
Whether it works or not would be up to the browser. My understanding is that browsers have the option to ignore, or disregard, some or any or all parts of CSS if there is an error. Depends on the browser, I suppose. |
![]() |
| Thread Tools | |
| Display Modes | |
| |