Forum Moderators: not2easy
I know this is not the most elegant way of approaching this, and that I should instead either add the style to the CSS file or to CSS style code in page header, but for different reasons, these are not options. I'm trying to get around having to do something like: <li style="margin-left: 12px"> for each list item.
thanks, David.
If external or embedded, then give the <div> an id or class. (Note: An id is much more powerful, but can only be used once per page. If there is any chance that it might be used more than once on that or another page, then use a class. I tend to be tight with id usage unless certain that it will see only one time per page usage. Sometimes things change and one wishes that they had used a class and not an id.)
........................
#target-div ul li {
margin-left: 12px;
}
This will apply the specified margin-left: to every <li> in an <ul> in a <div> with the id target-div.
<div id="target-div">
<ul>
<li>
List Item
</li>
<ul>
</div>
........................
You don't have to call this from the <div>. You might want to simply id or class the list - <ul id="target-list"><li> et cetera
ul#target-list {
margin-left: 12px;
}