PDA

View Full Version : CSS layout question



Xander
03-12-2007, 06:11 PM
Wondering if anyone here knows about layouts in CSS. Or a good CSS forum if not :D

See this page: http://www.rawrsome.com/css_blocks.html

We want Score to display above quiz in css, but not in the code. (the quiz code has to come first to calculate score. This is the closest Ive got but the margin pushes the score text to the right. Just want it to look normal like:

[score]

[quiz]


but quiz followed by score in the code.

Thanks if you can help :) Dont really want to absolute position things.

Dr Unne
03-12-2007, 07:54 PM
Easiest would be change whatever code is calculating the score to store the values in variables and then output them in the proper order. Any programming language should let you do that.

Barring that, I don't know of a way to do this without using absolute positioning. But you can use relatively-absolute positioning so that it's locally absolute rather than absolute to the whole page. See attachment. Note that the quiz and score are positioned absolutely only relative to the wrapper div, and you can put the wrapper div anywhere according to normal placement rules.

rubah
03-12-2007, 09:52 PM
What about a negative margin?

[edit- Added color to body because I didn't know why I couldn't see the word score xD and widths to make them prettier]
[edit1- it'll break if you increase your text size by a lot. If they're just going to stay close like that, maybe use an em instead of px or % in the margin]

Baloki
03-12-2007, 10:34 PM
:bou::bou::bou::bou::bou::bou::bou::bou: ftw!

Xander
03-12-2007, 11:47 PM
Those both look cool and useful thanks, I knew a bit about z index but not fully yet. xD its for my colleague who I was trying to help figure it out, so I will pass them on , its been really helpful :D

We had ways to do it with code but I think in the end we wanted to find out how to do it in css anyway XD