我需要在兩個標籤之間顯示一個文本區域,textarea需要使用可用的最大寬度,而不使任何標籤移出該行。在兩個全寬的標籤之間顯示一個文本區域
我一直在嘗試一些沒有太多運氣的樣式!
HTML
<body>
<div class="wrapper">
<span class="preTextContainer">Pre Text</span>
<span><textarea class="fullWidthTextArea">Some text area content</textarea></span>
<span class="postTextContainer">Post Text</span>
</div>
</body>
CSS
.wrapper {
white-space: nowrap;
}
.preTextContainer {
float:left;
}
.postTextContainer {
float:right;
}
textarea.fullWidthTextArea {
width: 100%;
}
的jsfiddle: http://jsfiddle.net/pGrpZ/
我試圖實現看起來像下面這樣:
不幸的是,標籤是動態的,因此這個問題:) – sanjayav
所以顯示動態標籤和如何演示希望視圖對它做出反應。 – Tejas
然後,您可能需要使用JS來獲取每個標籤的寬度,並從textarea的100%中減去它。雖然它是動態的,但百分比總是受到尊重,但裏面的文本需要調整到這個寬度。 – multimediaxp