Jump to content

Help with CSS div


aznjay

Recommended Posts

<html>

<head>

<link rel="stylesheet" type="text/css"

href="contrib.css" />

<title>

AllTraxx

</title>

</head>

<div>

<body background="alltraxxlayout.jpg">

 

<div id="nav">

lsoldjlehmcikhekfjmd

</div>

 

</body>

</html>

 

 

 

the CSS part:

 

 

body { font-family: Verdana, Arial, Times new roman;

font-size: 11px;

color: #color;

background-position: top center;

width:900;

height:2000;

background-repeat: repeat-y;

}

 

#nav {

position:relative;

top:1em;

left: 259px;

float:left;

height:250;

width:145;

background-color:#000;

}

 

 

Link to comment
Share on other sites

You are having this issue because you are using relative (fixed) positioning. By definition, this causes your element to be placed where you define, and it will not change when the browser is resized. Also, there is no point in using both a fixed placement and a float. If you describe what you are wanting to achieve, I'm sure we can help you. Try something like this in the meantime:

 

HTML

<body>
<div id="wrapper">
  <div id="nav">asdfasdfasdf</div>
</div>
</body>

 

CSS

#wrapper {
  width: 900px;
  margin: 15px auto;
}

#nav {
  float: left;
  height: 250px;
  width: 145px;
  background-color: #efefef;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.