View Full Version : multiple layout with same markup

09-25-2012, 02:55 PM
Hi i have been playing around with html and css for a bit now and decided to create a site with multiple layouts, i want to set up my html and then use the css to get the layout i require. I assume this is possible, but cant work out how to make big variatio s without vhanging the html i.e. layout A will have buttons 1 2 3 at the botyom while layout B will have them at the top.

ive looked for tuts but must be searching th wrong thing as i cant find any.

09-25-2012, 05:18 PM
It's possible, but not only with HTML & CSS. With JavaScript you can move, remove and add elements in the DOM, but firstly imo it's not wise to let the layout of a page depend on JavaScript and secondly you will confuse your vistors with a website layout that is not consistant.

09-25-2012, 09:31 PM
Thats a valid point that i hadnt thought of. But if i use it as an excercise. Would it be feasiable to use php and store the stylesheets in a database? I wanted to initally show a few of my designs on one site which is why i considered it

09-25-2012, 10:33 PM
You can't make a complete different layout without touching the HTML or without using JavaScript.
You can do minor changes to it with the CSS float and position properties and it might be even possible to bring those buttons to the top with 'position: absolute', but... it's an unorthodox way of doing so.

I don't see how a stylesheet pulled out of a database can change the HTML.

d a v e
09-26-2012, 05:30 AM
a mixture of css garden style switching and showing/hiding different divs of content?? guess you're going to need js somewhere there.