Total members 11383 |It is currently Fri Nov 28, 2014 7:44 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R

All times are UTC [ DST ]



  inherit background color from the parent element
Sat Dec 03, 2011 11:52 pm 

Code:
<html>
<
head>
<
style type='text/css'>

#mainbar
{
  
background:#BBCC33;

}
#section
{
  
color:#fff;
  
background:#435234;
  
clear:both;
  
padding:0;
  
text-align:center;
  
font-size:1em;
  
height:2em;
  
line-height:2em;

 
}

a.testlink
{
  
background:inherit;
  
color:#FFFFFF;
  
text-decoration:none;
}

#section a:hover
{
  
text-decoration:underline;
}

 
</
style>
<
title>inherit background color from the parent element</title>
</
head>
<
body>
  <
div id="mainbar">
   <
div id="section">
 

     
test <a href="#" class="testlink" >link</a
      
   </
div>
    
test <a href="#" class="testlink" >link</a
   </
div>


</
body>
</
html>

 


_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : inherit background color from the parent element
 change background color with RGB     -  
 Background color - mile200     -  
 gradient background color using CSS     -  
 skymiles background color     -  
 Follow window background color     -  
 changing the background color for site main menu.     -  
 get parent class name     -  
 advantage of the event delegation model over event-inherit     -  
 Usage of big element tag.     -  
 Pop the element off the end of array     -  

All times are UTC [ DST ]



Topic Tags

CSS Background






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team