Forum Moderators: open

Message Too Old, No Replies

IE & FF not display the same with clip property (css)

         

g8tuananh

5:06 pm on Dec 3, 2006 (gmt 0)

10+ Year Member



this is my source code:

<!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>
<title>view</title>
<script type="text/javascript">
var nBien = 15;
function moveright()
{
nBien+=20;
document.getElementById("Div1").style.left = nBien+"px";

}
function moveleft()
{
nBien-=20;
document.getElementById("Div1").style.left = nBien+"px";
}
</script>
</head>
<body > <!--top right botton left -->
<div id="example" style="clip: rect(0px, 190px, 75px, 0px); left: 346px; top: 274px; width: 190px; height: 75px; position: absolute; border-right: #ff0033 1px solid; border-top: #ff0033 1px solid; border-left: #ff0033 1px solid; border-bottom: #ff0033 1px solid;">
<div id="Div1" style="left: 2px; top: 2px; width: 186px; height:71px; position: absolute;">
An angel's smile is what you sell
You promise me heaven
</div>
</div>
<br /><br /><br /><br /><br />
<a href="#" onclick="moveright()">moveright</a>
<a href="#" onclick="moveleft()">moveleft</a>
</body>
</html>

when i view with IE, the border display correct, but script not desire
with FF, the border does not correct, but script done.
how can i fix this problem?
thanks

g8tuananh

4:42 am on Dec 4, 2006 (gmt 0)

10+ Year Member



thanks for read.
i fix it. clear comma

clip: rect(0px, 190px, 75px, 0px);

clip: rect(0px 190px 75px 0px);