我目前正在一個新的網站上工作,我遇到了問題。 我有2 div的旁邊eachother,一個內容和一個背景圖像。CSS div無內容擴展
與內容的DIV是媒體鏈接自動在它的內容現在
擴大,一個與背景圖像僅僅是設計,在它裏面沒有任何內容,我希望它與一個全自動擴大與內容,所以他們都有相同的高度。
這裏有2個截圖讓我的問題更加清晰。
HTML:
<div id="bubble">
Stad Turnhout
</div>
<div id="date">
<span class="created">created</span><br/><span class="date">okt<br/>2011</span>
</div>
</div>
<div id="slash">
</div>
<div class="textfield">
<p class="text">
Text goes in here
</p>
</div>
CSS:
#slash {
float:left;
width:20px;
height:auto;
background:url(images/slash.jpg) no-repeat, url(images/socialbg.jpg) repeat;}
.textfield {
padding:25px;
width:269px;
height:auto;
float:right;
background:url(images/point.jpg) no-repeat, #FFF;}
我一直想幾件事情,並試圖找到對谷歌的東西,但沒有是有用的。 任何想法如何解決這個HTML/CSS?
感謝
編輯:加入我的代碼
告訴我們您的HTML/CSS – krish
向我們展示你的HTML和CSS或創建的jsfiddle演示 – Champ
檢查此頁面http://www.w3schools .com/css/tryit.asp?文件名= trycss_background_shorthand2 – 2012-09-10 12:29:50