raygold Posted February 19, 2013 Share Posted February 19, 2013 I have the following html code: <div class="firstclass" id="firstid"> <div class="a-block-content"> <h2 class="text-align-center"><a href="#">Some text</a></h2> </div> </div> How can I edit only h2 element using #firstid? Is it possible edit the second div container style <div class="a-block-content"> <h2 class="text-align-center"><a href="#">Some text</a></h2> </div> using #firstid? P.S. I can't edit html code, only css style. Link to comment Share on other sites More sharing options...
thescientist Posted February 19, 2013 Share Posted February 19, 2013 you could use javascript/jquery if you need to manipulate the DOM and are abstracted away from the actual markup itself. Link to comment Share on other sites More sharing options...
raygold Posted February 19, 2013 Author Share Posted February 19, 2013 What about css selectors? Can I use them to solve my issue? Link to comment Share on other sites More sharing options...
dsonesuk Posted February 19, 2013 Share Posted February 19, 2013 Using id ref #firstid h2 a{color: red;} would give it higher precedence over .a-block-content h2 a {color: lime;} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now