Jason Young
Jason Young

Reputation: 575

is this is a css bug of firefox

here is my test 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style>
*{
margin:0;
paddin:0;
}
.warp{
    background:#0F6;
    position:relative;
    width:100px;
    height:100px;
    left:50%;
}
.line{
    position:fixed;
    width:10px;
    height:120px;
    background:#F00;
}
</style>
<body>
<div class="warp">
    <div class="line"></div>
</div>
</body>
</html>

in chrome and ie10 the "line" div is on left side,but in firefox,it stay with div "warp", the "line" is a "fixed position" div, it should rendered like chrome and ie ,i think.

http://jsfiddle.net/AWdqY/

Upvotes: 2

Views: 67

Answers (1)

Jon Newmuis
Jon Newmuis

Reputation: 26520

You can simply define the left property on the element (left: 0).

http://jsfiddle.net/AWdqY/1/

Upvotes: 1

Related Questions