I have an unordered list and each of the item in the ul has a div with it. This div loads a html page using jQuery. The style I've given for the ul is getting applied for the whole html which loads in the div. How to prevent that from happening . I want the style for the div to be applied only to itself and not to any of the descendants.
I can try to add specific styles to the descendants but there are too many tags inside.
<ul class="expr">
<li><a class="textlink trig" href ="javascript:void">Using the z-index property of CSS</a>
<div class="holder"></div></li>
<li><a class="textlink" href ="javascript:void">Swapping Images on Mouse Hover</a></li>
</ul>
Css:
ul.expr
{
font-size: 125%;
font-weight: bold;
list-style: none;
margin: 0.5em 0;
padding: 100px 20px;
color: #1e1a19;
}
HTML after page load:
<ul class="expr">
<li>
<a class="textlink trig" href="javascript:void">Using the z-index property of CSS</a>
<div class="holder" style="display: block;">
<title> Image Hover Swap experiment </title>
<h4> Experiment 2. Swapping Images on Mouse Hover </h4>
Lot of text
<br>
More Text
<br>
Extra Text
</div>
</li>
Here ul has the styles from the "expr" class. The div "holder" loads dynamic content. I dont want any of the "expr"s styles to be added to the div inside. But i want them to be applied to the the other "li" list items and subsequently not the divs inside other list items too.