Home >Web Front-end >HTML Tutorial >Why is there a distance between my div and parent div? _html/css_WEB-ITnose

Why is there a distance between my div and parent div? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:09:221027browse

67e1a5d2754ba0a5e30a749f8b30bd4c
            200221977f6a8d486a168b01e688046b
                2fc86a36074427fcd8c99827c8f29ec9
                54fb9a3b24b130b1fb4da77404ea7c461.Select Roombed06894275b65c1ab86501b08a632eb
                e61fc4db54d2bb59828a1939ba4821da2.Customer Infobed06894275b65c1ab86501b08a632eb
                e61fc4db54d2bb59828a1939ba4821da3.Paymentbed06894275b65c1ab86501b08a632eb
                929d1f5ca49e04fdcb27f9465b944689
            16b28748ea4df4d9c2150843fecfba68
            cb1c2c2deed30544f43b4827711a3e75
            16b28748ea4df4d9c2150843fecfba68
16b28748ea4df4d9c2150843fecfba68
不明白红色的那两个div之间为什么会有一段空白距离?


回复讨论(解决方案)

里面的ul会有默认的margin和padding,设为0就没了。

里面的ul会有默认的margin和padding,设为0就没了。
原来这样呀,谢谢。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>    <title></title>   </head><body><div style='border:solid 1px blue;width:600px;float:right;'><div style="height:30px;width:600px;background-color:#626262;color:#ffffff;margin-top:0px;float:right; ">  <ul id="steptips" style="list-style-type:none;">  <li class="horizontal" style="display:inline;margin:auto 10px;padding:auto 8px;color:red;">1.Select Room</li>  <li class="horizontal" style="display:inline;margin:auto 10px;padding:auto 8px;color:white;">2.Customer Info</li>  <li class="horizontal" style="display:inline;margin:auto 10px;padding:auto 8px;color:white;">3.Payment</li>  </ul>  </div>  <div style="width:600px;margin:auto;">  </div></div></body></html>

这样吗?

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