Using CSS, is there any way to show a div which is there inside an li element? i don’t wanna use any javascript for this.
here is my sample code for this.
<ul>
<li id="help">
Help
<div id="helpContainer">
This is the help text content
</div>
</li>
</ul>
CSS
#helpContainer
{
display:none;
}
here it is, i wanna display helpContainer div on click of li(id=help)
You must use Javascript to manipulate the DOM (Document Object Model) of the page.
This article describes how to use the #anchor tag coupled with the puesdo-class :target CSS selector (http://reference.sitepoint.com/css/pseudoclass-target). This doesn’t really do what you want though (you would have to use an anchor tag to hit new # tags to put the page in different states whereas with Javascript you could just assign a listener to the onclick event on the object you actually care about), and I would never use this in practice.