html - What are the advantages of a page-wrapping div and should I use one anyway? -


i'm back-end programmer every , need put human-friendly face on something, , end becoming web designer/dev day.

more few times layout issues have been solved wrapping everything in div directly inside <body> tags , applying styling that, sticky footers or pushing content down fill at least height of viewport. because use use infrequently, tend forget intricacies of html/css, i'm wondering should wrap body content in div practice?

on 1 hand:

  • it seems commonly suggested solution stretching content way down (sidebars seem menace this).
  • even if don't need start with, may need in future, , putting there start means less affect rest of page if need add 1 later.

but feel there's enough don't know web page rendering overall detrimental somehow. semantic? open potential bigger problems other parts of page? clean code , scanning through work , able tell @ glance , why there. feels off me div purpose not clear.

not have wrap body content div. historically web content only. can trace how names has changed on time.

webpage - page in web. page book page, simple text. text has flow layout. styling minimal (in terms of location). not important underneath when content finished, rest of blank page.

and mention term viewport. place content , control elements. modern web-page not classic page anymore, application nowadays. term web-page in use. try calculate how of page space takes text content (flow layout) , rest(buttons, images, video, controls - block layout) example on facebook

element div become universal element used split content logically separate blocks. element div block max available width of parent , height of inner content. visual presentation of div element can changed using styling. there lot of new semantic elements in html5 emulated div element previously. easy guess such elements header, footer, aside, nav...

main idea of div split content logically , style need.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -