Home > Web Front-end > HTML Tutorial > div宽度固定_html/css_WEB-ITnose

div宽度固定_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:53:26
Original
1196 people have browsed it


<html><head><title>我的第一个 HTML 页面</title></head><body><div style="height:45px; width:200px; border:1px; background-color:Red; overflow:auto; display:inline;white-space: nowrap;"><div style="height:45px; width:45px; border:1px; background-color:Blue; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Green; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:LightBlue; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Grey; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Purple; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Yellow; float:left;"></div></div></body></html>
Copy after login
Copy after login


回复讨论(解决方案)

<div style="height:64px; width:200px; border:1px; background-color:Red; overflow:auto; display: inline-block;white-space: nowrap;"><div style="height:45px; width:45px; border:1px; background-color:Blue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Green; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:LightBlue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Grey; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Purple; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Yellow; display: inline-block;"></div></div>
Copy after login


<html><head><title>我的第一个 HTML 页面</title></head><body><div style="height:45px; width:200px; border:1px; background-color:Red; overflow:auto; display:inline;white-space: nowrap;"><div style="height:45px; width:45px; border:1px; background-color:Blue; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Green; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:LightBlue; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Grey; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Purple; float:left;"></div><div style="height:45px; width:45px; border:1px; background-color:Yellow; float:left;"></div></div></body></html>
Copy after login
Copy after login


您好,再请教您一个问题,见下面

<html><head><title>我的第一个 HTML 页面</title></head><body><div style="height:45px; width:200px; border:1px; background-color:Red; overflow:auto; display: inline-block;white-space: nowrap;"><div style="height:45px; width:45px; border:1px; background-color:Blue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Green; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:LightBlue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Grey; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Purple; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Yellow; display: inline-block;"></div></div></body></html>
Copy after login
Copy after login


和代码

<html><head><title>我的第一个 HTML 页面</title></head><body><div style="height:45px; width:200px; border:1px; background-color:Red; overflow:auto; display: inline-block;white-space: nowrap;"><div style="height:45px; width:45px; border:1px; background-color:Blue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Green; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:LightBlue; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Grey; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Purple; display: inline-block;"></div><div style="height:45px; width:45px; border:1px; background-color:Yellow; display: inline-block;"></div></div></body></html>
Copy after login
Copy after login


只是div间回车不一样,为什么效果不一样?


效果图如上

aa

a
a
效果也不一样啊

aa

a
a
效果也不一样啊



好的,谢谢
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template