http://jsfiddle.net/adamadam123/qv2yR/CSS +大小不同的文本區域,以適應圖像
內以上是我目前正在使用的代碼。下面是我想要實現的圖像。
它基本上是一個聊天框「IM」和我有一個藍色的&粉紅色的圖像,需要能夠獲得不同數量的文本圖像內坐。
我也嘗試使用圖像作爲CSS背景,但發現它沒有拉伸以適應文本。還嘗試了浮動和絕對定位。
任何幫助將不勝感激。
THX
<div class="chatMessengerBody">
<div class="chatMessengerChatBubble chatMessengerChatBubbleBlueWrapper">
<img src="images/chat-messenger-chat-bubble-blue.png" class="chatMessengerChatBubble chatMessengerChatBubbleBlue"/>
<p class="chatMessengerChatBubbleContent">Great, thanks for asking. Never better to tell you the truth. So how about those dolphins?
Great, thanks for asking. Never better to tell you the truth. So how about those dolphins?
Great, thanks for asking. Never better to tell you the truth. So how about those dolphins?
</p>
</div>
<div class="chatMessengerChatBubble chatMessengerChatBubblePinkWrapper">
<img src="images/chat-messenger-chat-bubble-pink.png" class="chatMessengerChatBubble chatMessengerChatBubblePink"/>
<p class="chatMessengerChatBubbleContent">Great, thanks for asking. Never better to tell you the truth. So how about those dolphins?</p>
</div>
</div>
而不是圖像爲什麼不使用具有一些填充,背景顏色和邊框的div? – Jrod