This should do it for you: http://jsfiddle.net/MFtU2/1/
ul > li:not(:first-child) {
margin-left: 50px;
}
If you wish to support legacy browsers that do not support the CSS3 :not()
selector, your best bet is to select the first li
and give it margin:0;
while giving all li
a margin of 50px
: http://jsfiddle.net/MFtU2/3/
ul.ie8safe > li:first-child {
margin-left: 0;
}
ul.ie8safe > li {
margin-left: 50px;
}
EDIT:
Given that the OP has changed the parameters of the question slightly, I figured I'd update my answer. In addition to wanting to target all li
s other than the first, you also want to get them to display on the same horizontal plane. To do this, you'll want each li
to take up the minimum amount of space possible since, by default, each li
will take up the full width of the containing ul
. There are a couple ways to do this, but I prefer using float: left;
ul > li {
float: left
}
ul > li:not(:first-child) {
margin-left: 50px;
}
I've attached an updated fiddle to show what this would look like. Note that this technique will work across legacy browsers as well as newer ones.