
Originally Posted by
redhillccwebmas
The way you have shown in the only way to do it via fixed-dimension margins. Relative-dimensions would work better in your favour, as the margin of the child would be relative to the parent
Hope this helps
James
That's not exactly true. Using a fix size, an element will always (presuming it's not absolute positioned) nest based on it's parent so this can be achieved quite simply applying the margin to one <ul> and the rest will indent accordingly
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>List Example</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
ul {
margin-left: 15px;
}
</style>
</head>
<body>
<ul>
<li>Item one
<ul>
<li>Item two
<ul>
<li>Item three</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>
Bookmarks