dcanup
05-24-2007, 01:59 PM
I am designing my works website from the ground up and I am having some problems doing one of the things that I thought would be simple. I am post in my test code below so you can see what I am trying to do...in the code is also my two questions.
I will restate my questions here too though....
1) How can I get a my "block" (div element) to start at the very top left of the page?
2) Why does my height of my block not work when the width does?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Untitled Page</title>
<style>
#test {
background-color: black;
color: white;
top: 0px;
left:0px;
margin: 0px;
height: 40%;
width: 50%;
}
</style>
</head>
<body>
<div id="test">
<p>How can I get this block so it is at the very top left of this page?</p>
<p>I set the height of the block at 40% of the page height but that does not work like I though it would even though the width part does work...So how do I get that part to work?</p></p>
</div><!-- close "test" -->
</body>
</html>
Thanks to all that take the time to read this post...
I will restate my questions here too though....
1) How can I get a my "block" (div element) to start at the very top left of the page?
2) Why does my height of my block not work when the width does?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Untitled Page</title>
<style>
#test {
background-color: black;
color: white;
top: 0px;
left:0px;
margin: 0px;
height: 40%;
width: 50%;
}
</style>
</head>
<body>
<div id="test">
<p>How can I get this block so it is at the very top left of this page?</p>
<p>I set the height of the block at 40% of the page height but that does not work like I though it would even though the width part does work...So how do I get that part to work?</p></p>
</div><!-- close "test" -->
</body>
</html>
Thanks to all that take the time to read this post...