Log in

View Full Version : Aligning DIVS?



Blinger1
21-12-2006, 11:58 AM
How do i center a div? I have tried adding "align=center" to the end of the div stuff just before the < but it doesn't work.

YouFail
21-12-2006, 03:38 PM
well. At the start of your page just use



<div align="center">

other code here

</div>

Mentor
21-12-2006, 05:42 PM
Aligning a div tends to be strangly tricky, when you want the code to do it in the div, easiest way tends to be setting the margins to auto, while haveing a fixed width, it tends to do the job.

[Oli]
21-12-2006, 06:29 PM
Aligning a div tends to be strangly tricky, when you want the code to do it in the div, easiest way tends to be setting the margins to auto, while haveing a fixed width, it tends to do the job.

Like he says but he forgot to mention thats with Css

I recommend you to use css, much more precise to postition, like



#divname {
position: absolute;
left: 200px;
top: 120px;
}


Stuff like that

Blinger1
21-12-2006, 09:56 PM
oh awesome +rep to everyone who helped :) i used this code


#divname {

position: absolute; left: 200px; top: 120px;

}

also, is there anyway to convert my divs into tables :)?

YouFail
22-12-2006, 10:16 AM
Converting them to tables defeats the purpose of DIV's.

Blinger1
23-12-2006, 12:56 AM
tables i reckon look much nicer ;)

:Blob
23-12-2006, 09:45 AM
tables i reckon look much nicer ;)

Not if you style them correctly.

Want to hide these adverts? Register an account for free!