html - Difference between Main element, Content div and wrapper div? -


can explain when use these elements or these interchangeable?

thanks in advance.

the <main> element must occur once on page, , cannot child of <article>, <aside>, <footer>, <header> or <nav> element. it's typically put role="main" attribute if you're working accessibility.

there no pre-defined <content> element, though free create own.

the <div> element (as in <div class="content"> , <div class="wrapper">) can go wherever flow content expected. means can have (almost) element parent.

the classes affixed above 2 <div> elements denote different styling rules. typically, class of .wrapper used defined main body of document, , control how 'offset' should edge of page. such, there one occurrence of <div class="wrapper"> on page. class .content used define , separate out individual blocks of content, , such, there multiple <div class="content"> blocks on page.

although classes .wrapper , .content fairly commonly-used (and built number of frameworks), under no obligation make use of them.

hope helps! :)


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -