div 怎么没高度_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:46:29
Original
902 people have browsed it

问题:
为什么div没有高度,必须要设置height才行? 它不能自动扩充为内里内容的高度吗?

<div class="tools_r_mail">        <a class="btn_mail" href="/Mail/Write/79?typeId=21">            <span>回 复</span></a>         <a class="btn_mail" href="/Mail/Write/79?typeId=24">                <span>回复所有</span></a></div>
Copy after login




回复讨论(解决方案)

你问的问题和你发的代码有关系吗?


你问的问题和你发的代码有关系吗?


因为我在div里边设置了背景,结果发现效果没出来。

后边要设置height才行

但是里边不是有内容吗?


回 复


回复所有


我以为div会自动扩张,把上边内容包括进来

<style type="text/css">.tools_r_mail { font:12px;      height:800px;      color:#339966;      border:1px #e1763d solid;}</style>
Copy after login
Copy after login
Copy after login

<style type="text/css">.tools_r_mail { font:12px;      height:800px;      color:#339966;      border:1px #e1763d solid;}</style>
Copy after login
Copy after login
Copy after login


就是说必须要设置 height对吧?


<style type="text/css">.tools_r_mail { font:12px;      height:800px;      color:#339966;      border:1px #e1763d solid;}</style>
Copy after login
Copy after login
Copy after login


就是说必须要设置 height对吧?
父元素没有高度

height:auto;

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