तत्वों के शीर्ष को गठबंधन करते समय मुझे एक div के चारों ओर लपेटने के लिए पाठ प्राप्त करने में कोई समस्या नहीं है, लेकिन मैं यह नहीं समझ सकता कि पाठ ऊपर और नीचे div को कैसे लपेटें।एक div के ऊपर और नीचे पाठ रैप कैसे करें?
उदाहरण के लिए मैं चाहता हूं कि पाठ 40px के लिए # कंटेनर की पूरी चौड़ाई हो, फिर दाईं ओर इसे चारों ओर लपेटें, और फिर पूर्ण चौड़ाई पर जाएं।
इसे http://jsfiddle.net/cope360/wZw7T/1/ पर देखें। जहां मैंने शीर्ष-मार्जिन #inset में जोड़ा है, जहां मैं टेक्स्ट को लपेटना चाहता हूं। क्या यह संभव है?
सीएसएस:
#inset {
width: 100px;
height: 100px;
background: gray;
float: left;
margin-top: 40px;
}
HTML:
<div id="container">
<div id="inset">Inset</div>
This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around. This text should wrap all around.
</div>
क्या कंटेनर को HTML में पहले बच्चे के रूप में होना चाहिए? या आप इसे टेक्स्ट में कहीं भी रख सकते हैं? – Marnix
@ मार्निक्स, इसे कहीं भी रखा जा सकता है। एचटीएमएल किसी भी तरह से संरचित किया जा सकता है। मैंने बस सबसे आसान उदाहरण बनाने की कोशिश की जो समस्या को दिखाता है। – cope360