Jump to content

color entire content


zdarkmind94
 Share

Recommended Posts

I think he means with the code like----

<div style="color:#F00">   // edited    <h1>Hello World</h1></div>

it will work if you put <div> inside <h1>. like ---

<h1><div style="color:#F00">   // edited    Hello World</div></h1>

but I suggest, when u r using style to a <div> or <p> or whatever, you need not to use <h1> or <h2> or whatever. just extend ur style with font:size; font-weight or whatever u need.....

Edited by funbinod
  • Like 1
Link to comment
Share on other sites

???? More confused now, If you set color (note: style="color:#F00;" NOT style:"color:#F00;") stying to parent div all child element will adopt parent color unless h1 has somehow been given a color styling with higher precedence as when used along with a id reference, which we will never know unless the html and css styling is provided so we don't as said from the start GUESS!

Link to comment
Share on other sites

<div class="content row">
<div class="large-8 large-centered columns">
<h2>Lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis, deserunt, ipsam, magni ex architecto id harum repudiandae cumque modi dolorum obcaecati tempora eius ad et perferendis ratione eum mollitia adipisci.</p>
<a href ="#0" class="button readmore">Citeste tot</a>
</div>
</div>
and i put the next css
.content {
position: relative;
z-index: 4;
color: #fff;
text-align: center;
padding-top: 5%;
}
why i need to put ( .content h2 {color:#fff;} ) to transform my h2 white?
Link to comment
Share on other sites

Because it is, it seems, using a grid system, it is probably using css selector somewhere that has a higher precedence than your current css styling, if you look at the header within firebug it should show the selector styling the header, you then have to use the same selector, that is positioned lower than current as the styles are applied, OR give it a selector that would give it a totally higher precedence over current.

Edited by dsonesuk
Link to comment
Share on other sites

Hi try this code, by changing below div color value entire elements (exclusive of anchor) color will be change. What is ur problem exactly?
<html><head><style>
.B {color:#FF0909;} // put A instead of class B
</style></head>
<body>
<div class="A">
<div class="B">
<h1>Lorem ipsum</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis, deserunt, ipsam, magni ex architecto id harum repudiandae cumque modi dolorum obcaecati tempora eius ad et perferendis ratione eum mollitia adipisci.</p>
<a href ="#0" class="button readmore">Citeste tot</a>
</div>
</div>
</body>
</html>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...