i know padding inherits the specified background color by default suppose i want a different color for padding can i specify with html/css, and if so, how? with thanks
No. Instead, you should consider using borders and specify the border color as the color that you would want the colored padding to be. Otherwise, place another element within the element you want colored padding in, and change the background color of the outer element to the color you would want the colored padding to be. The second technique allows you to have a different border color, "padding color", and background color.
Everyone before you had already said that. What's the point adding one more post saying the same thing. Perhaps post-padding is only motive?
Zing! Actually, you can achieve that effect using an inset box shadow, but only in the latest browsers. Of course, that means it fails in IE8 or lower. <html> <head> <style type="text/css"> #wrapper { box-shadow: inset 0 0 0 10px #f00; -moz-box-shadow: inset 0 0 0 10px #f00; -webkit-box-shadow: inset 0 0 0 10px #f00; border: 1px solid #000; padding: 10px; width: 100px; height: 100px; } </style> </head> <div id="wrapper"></div> </body> </html> Code (markup):