Home >Web Front-end >HTML Tutorial >这个什么问题_html/css_WEB-ITnose

这个什么问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:34:411055browse

<div id = "top">		<span id = "logo"></span>	</div>


#top{	background:url(../images/top_bg.png);	width: 100%;	height: 125px;}#logo{	background:url(../images/logo.png);	width: 200px;	height:125px;}


为什么 logo.png不显示的


回复讨论(解决方案)

span是行内元素,不能设置width、height值,改用div即可。

在#logo中添加display:block;就OK了,因为span是内联级元素,设置width没有用,所以需要转化成块元级元素

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