Top and Left property not working! Why?
I recently took up learning some css... and I am getting stuck on some very basic hurdles.
I can't get the top and left properties to work on this basic page that I was creating.
Below is all the code for that page... all the properties work except the top and left.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona开发者_开发技巧l.dtd">
<html>
<head>
<style type="text/css">
#firstdiv {border: 2px solid red;
position: absolute;
top:15px;
left:25px:}
#seconddiv {border: 2px solid green;
position: absolute;
top:65px;
left:5px:}
</style>
</head>
<body>
<div id="firstdiv">This is my first div </div>
<div id="seconddiv">This is my second div</div>
</body>
</html>
Any help on this issue would be greatly appreciated! = D
You have colons after left instead of semi-colons
#firstdiv {
border: 2px solid red;
position: absolute;
top:15px;
left:25px;
}
#seconddiv {
border: 2px solid green;
position: absolute;
top:65px;
left:5px;
}
精彩评论