/    Sign up×
Community /Pin to ProfileBookmark

css positioning (again)

hi all,

i am trying to create a products page without using tables ? ..

the page has the following elements..
#banner (750px wide 160px high).
#navigation (160px wide).
.product(555px wide 100px high).
#footer (750px wide).
.sidebar (160px wide).

the .sidebar is just a just a grey box to stop the left side under the navigation looking so empty.
i did think of using a grey backgorund for the navigation and setting the height to achive this but im using a nice background for the nav and dont want to lose it.

i have the following css:
<style type=”text/css”>
<!–
* {
margin:0;
padding:0;
}

body {
width:752px;
margin-right: auto;
}

#banner {
height: 160px;
width: 750px;
border:1px solid #000;
}
#navigation {
width: 159px;
float:left;
border-left:1px solid #000000;
clear: both;
height: 300px;
}

#footer {
width:750px;
clear:both;
border:1px solid #000;
}
.product {
width: 500px;
border: 1px solid #000000;
float: right;
height: 100px;
}
.sidebar {
background: #CCCCCC;
width: 159px;
height: 200px;
}
–>
</style>
the problem i have is getting the sidebar to sit under the nav in IE NS and MOZ..

can achieve it in ie but not NS and MOZ..

any ideas how i can use css to acheive this?
or any other suggestions.

thx andy

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@Daniel_TJan 11.2005 — Add [font="courier"]float: left;[/font] and [font="courier"]clear: left;[/font] to your .sidebar class ?
Copy linkTweet thisAlerts:
@andyshepauthorJan 11.2005 — that works fine in ie but no NE MOZ...

heres the full page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta name="Content-Style-Type" content="text/css">

<meta http-equiv="content-script-type" content="text/javascript">

<title></title>

<style type="text/css">

<!--

* {

margin:0;

padding:0;

}

body {

width:752px;

margin-right: auto;

}

#banner {

height: 160px;

width: 750px;

border:1px solid #000;

}

#navigation {

width: 159px;

float:left;

clear: both;

height: 300px;

border: 1px solid #000;

}

#content {

width: 590px;

float:right;

border-right:1px solid #000;

border-left:1px solid #000;

background-color: #CCCCCC;

}

#footer {

width:750px;

clear:both;

border:1px solid #000;

}

.product {

width: 500px;

border: 2px solid #990000;

float: right;

height: 100px;

}

.sidebar {

background: #CCCCCC;

width: 159px;

height: 200px;

float: left;

clear: left;

}

-->

</style>

</head>

<body>

<div id="banner">

banner

</div>

<div id="navigation">navgation

</div>

<div class="sidebar">Content for class "sidebar" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div id="footer">

footer

</div>

</body>

</html>


in NS the products sit level with the sidebar instead of the nav.

andy?
Copy linkTweet thisAlerts:
@andyshepauthorJan 11.2005 — think ive found a solution.

nesting the sidebar div within the navigation div.

<body>

<div id="banner">

banner

</div>

<div id="navigation">navgation

<div class="sidebar">Content for class "sidebar" Goes Here</div>

</div>


<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div class="product">Content for class "product" Goes Here</div>

<div id="footer">

footer

</div>

</body>

andy
×

Success!

Help @andyshep 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.18,
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,
)...