Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text unerdunning another div

Status
Not open for further replies.

benluke4

Technical User
Jan 27, 2005
127
GB
I have one div inside another div, the text in the main(body) div runs under the other div is there any way to stop this??

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]

<html>
<head>
<title>Untitled</title>

<style type="text/css"><!--

#body {
    position: absolute;
    height: 500px;
    width: 780px;
	margin-left:auto;
	margin-right:auto;

}
#navigation {
	position: absolute;
	top: 0px;
	right: 0px;
	height: 500px;
	width: 130px;
	background-color: #FFFFFF;
	text-align: right;
	margin: 0px 0px 0px 0px;
	border: thin dotted #00CCFF;
	float: right;
}

--></style>
</head>
<body>
<div id="body"> 
    <h1 class="greeting">Welcome to W&P online - Professional Personalised Training 
      in Care </h1>
    <P class="bodytext">W&P Training Centre is a leader in NVQ training for the Care 
      Sector. Our unique approach is in providing high quality tailored training 
      and NVQ's in Care Homes and throughout the care industry. W&P has delivered 
      hundreds of NVQ's within the care sector, priding ourselves on the support 
      and high standards we offer our candidates during their NVQ's. Our professional 
      and experienced team will support you throughout your NVQ training ensuring 
      your success and helping you enjoy achieving your goals! We will always 
      tailor your Care NVQ's to suit your needs and requirements. We offer a comprehensive 
      range of certificated training workshops which are shown on our training 
      page.</P>
    <div id="navigation">
      <ul id="nav">
        <li><a href="index.php">Home</a></li>
        <li><a href="#">NVQ's</a> </li>
        <li><a href="#">Training</a> </li>
        <li><a href="contact.php">Distance Learning</a> </li>
        <li><a href="log_out.php">Staff Training Packs</a> </li>
        <li><a href="log_out.php">CRB Checks</a> </li>
        <li><a href="log_out.php">Consultancy</a> </li>
        <li><a href="log_out.php">Registered Mngr Forum</a> </li>
        <li><a href="log_out.php">News</a> </li>
        <li><a href="log_out.php">Links</a></li>
        <li><a href="log_out.php">About us</a></li>
        <li><a href="log_out.php">Contact us</a></li>
      </ul>
      <div align="center"><img src="images_new/edx_web.gif" width="102" height="31"> 
      </div>
    </div>
  </div>
</div>

</body>
</html>
 
this seems to work;

padding-right: 150px;

would this be a correct way of doing it?
 
mmmm it only works in IE didnt think it was right
 
It would be ok enough. You are running into a problem with your css however. Auto margins on left and right suggest you wanted to put your page in the center, yet page is in the top left corner, due to absolute positioning. It is best to avoid absolute positioning as much as you can and if you change position: absolute; to position: relative; on your #body it will be centered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top