Home >Web Front-end >HTML Tutorial >初学HTML 有个简单的小问题帮忙看一下_html/css_WEB-ITnose

初学HTML 有个简单的小问题帮忙看一下_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 08:59:531169browse

<!DOCTYPE html PUBLIC "-//W3C//Dli XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/Dli/xhtml1-transitional.dli"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><style type="text/css">	*{margin:0;padding:0}	#one{width:800px;height:500px;background:blue;}	#two{width:500px;height:300px;background:red;}	#three{width:100px:height:100px;background:green;}</style></head><body>	<div id = "one">		one		<div id = "two">			two			<div id = "three">				three			</div>		</div>	</div></body>


很简单的2级嵌套  
但是所得到的效果却很反常 那个three我设定的大小是100*100 可为什么得到的图形是一个长条呢


回复讨论(解决方案)

FF 和IE都这样

FF 和IE都这样


width:100px:height:100px;
大哥 100px:height 你这里中间分割的是冒号不是分号
改成分号吧

  #three{width:100px:height:100px;background:green;}



这地方错了。
  #three{width:100px;height:100px;background:green;}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn