猿问

div不显示怎么回事

<!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>

<style>

*{margin:0;padding:0;}

body{width:1000px;height:100px;background:#F00}

.main{height:50px;background:#999}

.look{background:#009;width:800px;height:800px;margin:0 auto;}

.book{background:#FF0;height:150px;}

.look_top{background:#0F0;height;50px;width:70px;margin:0 auto;}

.look_left{background:#990;height:200px;width:200px;float:left;}

.look_right{background:#0FF;height:300px;width:300px;float:right;}

</style>

</head>


<body>

<div class="main"></div>

<div class="look">

<div class="look_left"></div>

    <div class="look_right"></div>

    <div class="look_top"></div>

</div>

<div class="book"></div>

</body>

</html>

look_top为啥不显示    在div里打字后才显示

听见你流泪
浏览 3469回答 4
4回答

淡雅的默

.look_top{background:#0F0;height;50px;width:70px;margin:0 auto;}高度写错了,后面冒号你写成分号了

Lynn丶Hung

因为你的look_top没有高度,你的height;50px;应该写为height:50px;分号写成冒号。

卡迪亚兹

讲真的。你的CSS的样式不要写在一行。。不然。。。哦呵呵呵~。太难找了
随时随地看视频慕课网APP
我要回答