Page 1 of 1
[Solved] CSS centering
Posted: Sat Feb 04, 2006 8:23 pm
by xEzMikex
ok well im using CSS now instead of tables in my php tutorial system witch will be realeased soon... HERE FIRST!!!! anyways i got some questions on CSS hoping somone here can help me.
1.How do i center CSS (i know about the div.container{} thing} and is there away so the size of things doesnt change? when you minimize and stuff
Posted: Sat Feb 04, 2006 8:31 pm
by timvw
The easiest (imho) method to "center" align something is the following:
Code: Select all
div#centerme {
margin: auto;
width: 500px;
}
Posted: Sat Feb 04, 2006 8:32 pm
by m3mn0n
Moving this to Client Side so it's in the proper forum.
Posted: Sat Feb 04, 2006 8:37 pm
by xEzMikex
it just moves to the left.... heres my code
Code: Select all
<html>
<head>
<title>Untitled Document</title>
</head>
<style>
div.pack{
background:#000000;
color:#FFFFFF;
position:relative;
left:25%;
width:50%;
}
div.banner{
background:#1C710D;
color:#33FF33;
margin:auto;
position:absolute;
height:100px;
width:700px;
}
</style>
<body>
<div class="banner">
Banner Here
</div>
</body>
</html>
GOT IT THANKA!