/    Sign up×
Community /Pin to ProfileBookmark

Multiple Layers Centered

I am starting to learn CSS and have got stuck at the first hurdle using dreamweaver!

I have 3 layers, one along the top, one underneath towards the left and then another on the right of this. I would like all these alligned in the middle when the site is viewed at different resolutions.
My css code is:

<style type=”text/css”>
<!–
#Top {
position:absolute;
left:104px;
top:28px;
width:792px;
height:183px;
z-index:1;
border: 1px solid #0066FF;
background-color: #FFFFFF;
}
#Left {
position:absolute;
left:103px;
top:230px;
width:196px;
height:600px;
z-index:2;
border: 1px solid #0066FF;
background-color: #FFFFFF;
}
#Middle {
position:absolute;
left:326px;
top:232px;
width:569px;
height:601px;
z-index:3;
border: 1px solid #0066FF;
font-size: 16px;
background-color: #FFFFFF;
}
body {
background-color: #D7FFFF;
}
–>
</style>

and body code is:

<body>
<div id=”Top”></div>
<div id=”Left”></div>
<div id=”Middle”></div>
</body>
</html>

I have searched the forum for help but I have only found a solution to make one layer centered but with 3 I cant seem to get it to work.

Thanks in advance for any help/pointers!

Dave

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsDec 06.2005 — &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;style type="text/css"&gt;
&lt;!--
body {
margin: 10px 0%;
}
#main {
margin: auto;
width: 792px;
}
#header {
float: none;
height: 183px;
}
#left {
float: left;
width: 196px;
height: 600px;
}
#right {
float: right;
width: 569px;
height: 600px;
}
#left,
#right {
margin-top: 23px;
}
#header,
#left,
#right {
border: 1px solid #06F;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="main"&gt;
&lt;div id="header"&gt;top&lt;/div&gt;
&lt;div id="left"&gt;left&lt;/div&gt;
&lt;div id="right"&gt;right&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@ray326Dec 06.2005 — I am starting to learn CSS and have got stuck at the first hurdle using dreamweaver![/QUOTE]That's problem #1. Don't try to learn fundamentals using a high end editor. Get [url=http://htmlkit.com]HTML-kit[/url] and work directly with the code. That will make you keep it simple until you know what you're doing. The big problem with your existing CSS is the absolute positioning.
×

Success!

Help @Cable83 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...