Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial div里面的内容跑到外面来了_html/css_WEB-ITnose

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

Jun 21, 2016 am 08:48 AM

1

<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>

Copy after login

我想点击然后下滑,这个功能实现了。一开始点击“请点击”的这个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或者请点击 多点几次就会发现了
你发个图我看看 在六楼
我试了很多浏览器,都没有出现你那个问题,你用的什么浏览器
火狐
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Mar 04, 2025 pm 12:32 PM

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

How do I use HTML5 form validation attributes to validate user input?

How to efficiently add stroke effects to PNG images on web pages? How to efficiently add stroke effects to PNG images on web pages? Mar 04, 2025 pm 02:39 PM

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

What is the purpose of the <iframe> tag? What are the security considerations when using it?

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

What is the purpose of the <datalist> element?

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

What is the purpose of the <meter> element?

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

What are the best practices for cross-browser compatibility in HTML5?

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

What is the purpose of the <progress> element?

See all articles