猿问

谁能告诉我这两个代码为什么在浏览器上不一样,一本用sublime一个用hb

sublime做的:

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

.main{

margin: 0 auto;

width: 810px;

height: 200px;

background-color: darkgray;

}

.left{

width: 200px;

background-color: red;

float: left;

height: 200px;

}

.right{

width: 600px;

height: 200px;

background-color: blue;

float: right;

}

</style>

</head>

<body>

<div class="main">

<div calss="left">left</div>

<div class="right">right</div>

</div>

</body>

</html>

Hbuilder做的

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>title</title>

<style>

.main{

margin: 0 auto;

width: 810px;

height: 200px;

background-color: darkgray;

}

.left{

width: 200px;

background-color: red;

float: left;

height: 200px;

}

.right{

width: 600px;

float: right;

background-color: blue;

height: 200px;

}

</style>

</head>

<body>

<div class="main"> 

<div class="left">left</div>

<div class="right">right</div>

</div>

</body>

</html>

效果:



http://img.mukewang.com/5720de8e0001da0110910410.jpg




DhA
浏览 1598回答 1
1回答

qq_青枣工作室_0

因为你Sublime后面的写错了<div class="main"> <div calss="left">left</div> <div class="right">right</div>上面的<div calss="left">left</div>里面的calss写错,要改为class
随时随地看视频慕课网APP
我要回答