Jump to content


Photo

Position Absolute - Css Validator Error?


  • Please log in to reply
2 replies to this topic

#1 mds1256

mds1256

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts

Posted 10 December 2012 - 09:14 AM

Hi

I use the following CSS (this is an example of my problem) but the CSS validator (w3c) reports that I have a redefination of top.

When looking at the CSS that has parsed through the validator it seems to be removing the right:0px; attribute and changing it to top:0px; instead?

Is there any reason why?

css:
 
/* CSS Document */
body{
margin-top:50px;
}

#wrapper{
position:relative;
width:300px;
height:200px;
border:#000000 1px solid;
}

#test{
position:absolute;
border:#000000 1px solid;
top:-6px;
right:0px;
}


html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
 <div id="test">tegdsfgsdgdsgst</div>
</div>
</body>
</html>



#2 kicken

kicken

    Wiser? Not exactly.

  • Gurus
  • 2,786 posts
  • LocationBonita, FL

Posted 11 December 2012 - 12:45 AM

It validates just fine for me if I copy/paste the css into the direct input box at w3's validator.  How are you running your validation?

Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#3 mds1256

mds1256

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts

Posted 11 December 2012 - 09:06 AM

It validates just fine for me if I copy/paste the css into the direct input box at w3's validator. How are you running your validation?


Hi, yeah it validates ok although it does show a warning (if you change the option to show all warnings)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com