HTML
<!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>无标题文档</title>
<link herf="布局练习css.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="box1">hziyi </div>
<div class="box2">hezier</div>
</body>
</html>
CSS
@charset "utf-8";
/* CSS Document */
.box1{
width:100px;
height:120px;
border:1px solid#F00;
}
.box2{
width:100px;
height:150px;
border:1px solid#039;
}
border:1px solid#F00;与border:1px solid#039;都是一样的问题,solid后面加上英文状态的空格即可。
border:1px solid #F00;
border:1px solid #039;
border:1px solid #039;注意空格。