1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is It possible to specify padding color?

Discussion in 'CSS' started by getbestproduct, Dec 28, 2010.

  1. #1
    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
    SEMrush
     
    getbestproduct, Dec 28, 2010 IP
    SEMrush
  2. AssistantX

    AssistantX Peon

    Messages:
    173
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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.
     
    AssistantX, Dec 28, 2010 IP
  3. karthimx

    karthimx Notable Member

    Messages:
    4,950
    Likes Received:
    125
    Best Answers:
    2
    Trophy Points:
    290
    #3
    no padding is an empty space we can't give color for that.
     
    karthimx, Dec 28, 2010 IP
  4. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Another silly question (the answer can be easily found with Google), post count padding maybe?
     
    CSM, Dec 28, 2010 IP
    domainmarket.io likes this.
  5. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #5
    No doubt mate. 2 motives, 1. Signature promo and 2. Post-padding.
     
    radiant_luv, Dec 28, 2010 IP
  6. cluongo18

    cluongo18 Member

    Messages:
    856
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #6
    Padding is transparent basically, so no color assigning to padding
     
    cluongo18, Dec 30, 2010 IP
  7. php.freak

    php.freak Member

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #7
    its not possible to give padding color.
     
    php.freak, Jan 2, 2011 IP
  8. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #8
    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?
     
    radiant_luv, Jan 2, 2011 IP
  9. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Zing! :D 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):
     
    Cash Nebula, Jan 3, 2011 IP