@Dr. John
Divititis indeed. I like using a lot of divisions; they allow maximum control. Are you telling me using a lot will cause rendering problems/slower page loads or do you think it's simpler using different methods?
@wyrd33
Thanks, I definatley got the elements where I wanted, it seems to get a bit sloppy though. Plus I can't overlap elements, do you know a way to do so?
@csswiz
1. Center tag is deprecated, thanks for pointing that out
2. I don't mind using divs unless you can persuade me otherwise
3. Why?
4. I agree; using hex rgb may get confusing, best to stay consistent.
I updated my code and have a few questions (still haven't changed the hex/rgb csswiz).
1. How do I overlap my boxes with one another
2. Why do I have to leave the "padding:" blank for it display propper margins/padding for my main container
Heres my code. Take a peek at it if you want and don't be shy if you think you know a better way of doing it. Thanks.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php
//variables
//title
$title_ = "Title";
?>
<style type="text/css">
*{
padding: 0;
margin: 0;
}
#myhr {
width: 90%;
}
body {
padding: 15px 0px 15px 0px;
margin-left:auto;
margin-right:auto;
margin-top:auto;
margin-bottom:auto;
width: 904px;
background-color:#CCCC66;
}
#container {
padding:
float: left;
width: 898px;
height: 900px;
background-color:#999999;
border: solid rgb(250,0,255);
border-width: 2px 2px 2px 2px
}
#link1{
margin: 0px 0px 0px 0px;
float: left;
width: 222px;
background-color:#CCCC66;
height: 25px;
border: solid rgb(250,0,255);
border-width: 2px 1px 2px 1px;
z-index:1;
}
#link2{
float: left;
height: 25px;
margin: 0px 0px 0px 0px;
width: 223px;
background-color:#CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 1px 2px 1px;
z-index:1;
}
#link3{
float: left;
margin: 0px 0px 0px 0px;
height: 25px;
width: 223px;
background-color:#CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 1px 2px 1px;
}
#link4{
float: left;
height: 25px;
width: 222px;
background-color:#CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 1px 2px 1px;
}
#innerbox{
width:136px;
height:177px;
margin: 0px 0px 0px 68px;
z-index:0;
background: #CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 2px 2px 2px;
}
#innerbox2{
width:136px;
height:177px;
margin: -182px 0px 0px 275px;
z-index:0;
background: #CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 2px 2px 2px;
}
#innerbox3{
width:136px;
height:177px;
margin: -182px 0px 0px 482px;
z-index:0;
background: #CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 2px 2px 2px;
}
#innerbox4{
width:136px;
height:177px;
margin: -182px 0px 0px 689px;
z-index:0;
background: #CCCC66;
border: solid rgb(250,0,250);
border-width: 2px 2px 2px 2px;
}
</style>
<title><? echo $title_; ?></title>
</head>
<body>
<div id="container"><br />
<h1 id="myh1" class="h1color_" align="center"><? echo $title_; ?></h1>
<div align="center">
<hr align="center" id="myhr" />
</div>
<br />
<div id="link1" style="background-color:#CCCC66"><p>link1</p></div>
<div id="link2">link2</div>
<div id="link3">link3</div>
<div id="link4">link4</div>
<!--<button onclick="positioning_width_other()">pos other</button>-->
<br />
<br />
<br />
<br />
<div id="innerbox"><p align="center">Box</p></div>
<div id="innerbox2"><p align="center">Box2</p></div>
<div id="innerbox3"><p align="center">Box3</p></div>
<div id="innerbox4"><p align="center">Box4</p></div>
</div>
</body>
</html>
Bookmarks