亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

overflow:hidden到底是咋回事 搞不懂呀? 有大神嗎?

<!DOCTYPE html>
<html>
<head>
?? ?<meta charset="UTF-8">
?? ?<title>Document</title>
?? ?<style type="text/css">
?? ?@font-face{
?? ??? ?font-family: iconfont;
?? ??? ?src:url(http://g.tbcdn.cn/tb/icon-font/1.1.5/iconfont.eot);
?? ?}
?? ?*{
?? ??? ?margin: 0;
?? ??? ?padding: 0;
?? ?}
?? ?body{
?? ??? ?font:12px/1.5 tahoma,arial,sans-serif;
?? ?}
?? ?a{
?? ??? ?text-decoration: none;
?? ?}
?? ?.search-tips a{
?? ??? ?float:right;
?? ??? ?color:#6c6c6c;
?? ??? ?padding: 3px 10px 0 15px;
?? ?}
?? ?.search-button{
?? ??? ?float:right;
?? ?}
?? ?.btn-search{
?? ??? ?background: url(http://gtms01.alicdn.com/tps/i1/T1qyj8Fc8aXXc4E9bI-400-300.png);
?? ??? ?width: 100px;
?? ??? ?height: 45px;
?? ??? ?background-position: 0 -200px;?? /*起始點是0 -200*/
?? ??? ?border: 0;?? /*去掉按鈕的邊框*/
?? ??? ?cursor: pointer;
?? ?}
?? ?.search-common-panel{
?? ??? ?height: 39px;
?? ??? ?background-color: #f50;
?? ??? ?overflow: hidden;?? /*超出它內容的 做隱藏處理?? 元素生成了BFC*/
?? ??? ?padding: 3px 0 3px 77px;
?? ?}?? ?
?? ?.search-common-panel input{
?? ??? ?height:39px;
?? ??? ?line-height: 39px;
?? ??? ?width: 100%;
?? ??? ?border:0 none;
?? ??? ?outline: 0;
?? ??? ?background-color: #fff;
?? ?}
?? ?</style>
</head>
<body>
?? ?<div>
?? ??? ?<div>
?? ??? ??? ?<form action="">
?? ??? ??? ??? ?<div>
?? ??? ??? ??? ??? ?<a href="#">高級<br/>搜索</a>
?? ??? ??? ??? ?</div>
?? ??? ??? ??? ?<div>
?? ??? ??? ??? ??? ?<button type='submit'></button>
?? ??? ??? ??? ?</div>
?? ??? ??? ??? ?<div>
?? ??? ??? ??? ??? ?<input type="text">
?? ??? ??? ??? ??? ?<i></i>
?? ??? ??? ??? ?</div>
?? ??? ??? ?</form>
?? ??? ?</div>
?? ??? ?<div></div>
?? ?</div>
</body>
</html>


一開始input的輸入域在下面?? 一加overflow:hidden 就上去了?

? 我也知道overflow:hidden 可以讓父元素? 高度撐起來包括子元素?

? 但在例子中父元素有39px的高度啊 ??? 并不是 沒有設置高度

納悶 子元素為什么一開始就在下面?? 在父元素的外面

? 這根本說不通???? 子元素在父元素外面只可能是定位定過去的? 怎么回事呢?

正在回答

1 回答

就是超出的部分會被隱藏起來

0 回復 有任何疑惑可以回復我~
#1

qq_我叫紅領巾_2 提問者

去知乎看了看 貌似這里不是這樣 形成了一個bfc
2017-02-23 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
搜索框制作
  • 參與學習       66022    人
  • 解答問題       463    個

本課程從簡入深講解搜索框的制作,學習JQ與JS實現Ajax技術的不同點

進入課程

overflow:hidden到底是咋回事 搞不懂呀? 有大神嗎?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號