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
https://forums.phpfreaks.com/topic/123437-help-with-css-div/#findComment-637508
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
https://forums.phpfreaks.com/topic/123437-help-with-css-div/#findComment-637588
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.