How to float inline elements using css
says that I have the following markup:
<ul class="editor"> <li> <a href="#">Modules</a> <a href="#">View</a> <a href="#">Add</a> </li> <li> <a href="#">Sections</a> <a href="#">View</a> <a href="#">Add</a> </li> </ul> how do I float 'view' and 'add' to the right so that the right so that they appear in the same order as html?
right now if i do
.editor li a:nth-child(2), .editor li a:nth-child(3){ float:right; } i get a string that looks like this:
Modules Add View but I want
Modules View Add Is this possible only through CSS3 ?
edit : sorry i should have mentioned i dont have access to html. only css
Try using the CSS3 flexible box model with explicit distribution and the box-ordinal-group property ( http://hacks.mozilla.org/2010/04/the-css-3-flexible-box-model/ ), and if you cannot To make it work with floats, perhaps it offers an alternative to achieve the same effect. In addition, of course, you can change the order of the DOM or simulate the layout in other ways, but this is not recommended if you want to keep your structure.