Is it possible to nest <div></div> inside of each other? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Is it possible to nest <div></div> inside of each other?

7th Oct 2022, 1:57 PM
MyNameIsNotBob
MyNameIsNotBob - avatar
5 Antworten
+ 4
Have you tried it? What did you experience?
7th Oct 2022, 2:14 PM
Lisa
Lisa - avatar
+ 1
Of course! Here is an example: <div class="div"> <div class="content"> <h1>Hello World</h1> </div> </div> Here is an example of the finished work, where I used nesting one block within another: https://code.sololearn.com/W3CHlXV2ytwk/?ref=app
7th Oct 2022, 3:01 PM
Knight
Knight - avatar
0
Yes it is possible. You can nest inside any block tags both inline tags and other block tags, while inside inline tags you can only nest other inline tags. A more reccomended way to do it in order to improve code lisibility is to use tags like article, section, aside, nav, header and footer. In case of errors feel free to offer details
8th Oct 2022, 5:47 AM
Stefan Corneteanu
Stefan Corneteanu - avatar
0
Lisa I was styling the divs individually, and it never styled.
8th Oct 2022, 8:51 PM
MyNameIsNotBob
MyNameIsNotBob - avatar
0
AJ 🇺🇦#PeaceForUkraine🇺🇦 could you give us an example?
9th Oct 2022, 4:16 AM
Stefan Corneteanu
Stefan Corneteanu - avatar