Heim  >  Artikel  >  Web-Frontend  >  div里面的内容跑到外面来了_html/css_WEB-ITnose

div里面的内容跑到外面来了_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 08:48:472894Durchsuche

<script type="text/javascript">	$(document).ready(function() {		$(".flip").click(function() {			$(".panel").slideToggle("slow");		});		$(".flip2").click(function() {			$(".panel2").slideToggle("slow");		});	});</script><style type="text/css">div.panel, div.flip, div.panel2, div.flip2 {	margin: 0px;	padding: 5px;	text-align: center;	background: #e5eecc;	border: solid 1px #c3c3c3;}div.panel {	display: none;}div.panel2 {	display: none;}ul li {	list-style-type: none;}</style><body>	<ul>		<li>			<div				style="width: 10%; height: 20px; float: left; text-align: right; overflow: hidden;">例子1</div>			<div class="flip" style="width: 88%; height: 20px; float: right;">请点击这里</div>			<div class="panel" style="width: 88%; float: right;">				<p>W3School - 领先的 Web 技术教程站点</p>				<p>在 W3School,你可以找到你所需要的所有网站建设教程。</p>			</div>		</li>		<li>			<div				style="width: 10%; float: left; text-align: right; overflow: hidden;">例子2</div>			<div class="flip2" style="width: 88%; float: right;">请点击这里</div>			<div class="panel2" style="width: 88%; float: right;">				<p>W3School - 领先的 Web 技术教程站点</p>				<p>在 W3School,你可以找到你所需要的所有网站建设教程。</p>			</div>		</li>	</ul></body>

我想点击然后下滑,这个功能实现了。一开始点击“请点击”的这个div会变长,我下写了高度,div固定了但是里面的字跑到外面去了。列子1和例子2这两个div也是,请问该怎么解决


回复讨论(解决方案)

没看到字跑到外面啊

试下
ul li {
    list-style-type: none;clear: both;
}

没看到字跑到外面啊

点列子1或者请点击 多点几次就会发现了

试下
ul li {
    list-style-type: none;clear: both;
}

不行


没看到字跑到外面啊

点列子1或者请点击 多点几次就会发现了
你发个图我看看


我想要这样的
但是会变成这样



没看到字跑到外面啊

点列子1或者请点击 多点几次就会发现了
你发个图我看看 在六楼




没看到字跑到外面啊

点列子1或者请点击 多点几次就会发现了
你发个图我看看 在六楼
我试了很多浏览器,都没有出现你那个问题,你用的什么浏览器





没看到字跑到外面啊

点列子1或者请点击 多点几次就会发现了
你发个图我看看 在六楼
我试了很多浏览器,都没有出现你那个问题,你用的什么浏览器
火狐
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn