考虑一下:
.foo {
position:absolute;
left:25px;
top:10px;
width:130px;
height:55px;
}
然后这个:
.change2 .foo {
left:45px;
top:90px;
}
这种变化就像一种魅力。但是,当更改为此时(基本上从左到右切换):
.change1 .foo {
right:15px;
top:90px;
}
它不起作用。问题是为什么。全部来源:
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>error example</title>
<style>
.Body {
position:relative;
padding:0;
margin:0;
height:400px;
width:400px;
border:1px dashed black;
font-size:14px;
}
.foo {
position:absolute;
left:25px;
top:10px;
width:130px;
height:55px;
}
.change1 .foo {
right:15px;
top:90px;
}
.change2 .foo {
left:45px;
top:90px;
}
</style>
</head>
<body>
<div class="Body change1">
<div class="foo">asdsdada</div>
</div>
</body>
</html>