/    Sign up×
Community /Pin to ProfileBookmark

PLZ help with positioning…

Ok, I understand that this issue has been overwhelmingly covered already, but I have been browsing the forum for hours now and just can’t seem to fix my problem.

Thing is, I centered a div (container) and the high-child div (banner) works fine, but the to bottom ones (left and right) keep floating away from the parent-div’s width.

I am really new to all this and any help would be fully apreciated.

The .css file:

[code]body {
cursor:default;
margin: 0;
text-align: center;
}

#container {

position: relative;
width: 810px;
margin: 0 auto;
border-spacing: 0px 0px;
right: auto;
left: auto;
clear: left;
padding: 0;
}

#banner {
width: 800px;
height: 310px;
margin: 0;
border-color: #999999;
color: #ffffff;
font: 8pt ‘Lucida Grande’, LucidaGrande, Lucida, Helvetica, Arial, sans-serif;
padding-top: 0px;
padding-bottom: 0px;
text-align: left;
}

#left {
width: 400px;
margin: 0;
padding: 0;
float: left;
}

#right {
margin: 0;
padding: 0 0 0 0px;
border-left: dashed #666666 2px;
float: right;
width: 200px;
}[/code]

The html code:

[code]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>

<title>:eveRlasT .//</title>
<meta content=”text/html; charset=ISO-8859-1″ http-equiv=”content-type”>

<link href=”stylish.css” rel=”stylesheet” title=”stylish.css” type=”text/css” />

</head>

<body>
<div class=”container”>

<div class=”banner”><img src=”interface/banners/random.php”></div>

<div id=”left”>lteste</div>

<div id=”right”>rteste</div>

</div>

</body>
</html>[/code]

I know it’s pretty clean right now, and I hope it helps you help me! …

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyJan 01.2007 — first, class is referenced in the stylesheet as . (period) and id as # (hash)

therefore change your stylesheet (or html) to reflect this. ie:

<div id="container"> is referenced in the CSS as #container

<div class="container"> is referenced in the CSS as .container
Copy linkTweet thisAlerts:
@ray326Jan 01.2007 — Well the first two divs should have ids, not classes.
Copy linkTweet thisAlerts:
@problemaauthorJan 01.2007 — Holy crap! That was effective. ?

Geez, I'ma have some trouble til I actually learn this thing...

Well, thanks a lot, I am very thankful for your help (though it made me look stupid :p ) and I shall now proceed to further headaches.

PS: it is comforting to know that I can get real help online, I'll try not to post stupid questions in the future...
Copy linkTweet thisAlerts:
@bathurst_guyJan 01.2007 — No problem. While we are on the issue of 'id vs class' maybe you would like to know the differences between them and why you would use one over the other.

http://www.w3.org/TR/html401/struct/global.html#adef-class

http://www.webdeveloper.com/forum/showthread.php?t=109986

http://www.webdeveloper.com/forum/showthread.php?t=85247
×

Success!

Help @problema 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.20,
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,
)...