TECKSPEED Posted April 24, 2014 Report Posted April 24, 2014 Hi all, Recently joined this forum and let me tell you what a great place for information on Web Development topics. First off I am relatively new to coding in CSS but not HTML. I would like to know if there are certain benefits to using the header, body, and footer id's in div tags rather than using a wrapper within a div and then placing your divs inside of that For example: <div id="wrapper"> <div id="header"> <div/> <div id="body"> As you can see above I placed a wrapper id around all of my other divs for certain formatting. Are there advantages for doing it this way rather than using the header and body id itself as the styling tag? Thanks in advance, TECK Quote
falkencreative Posted April 24, 2014 Report Posted April 24, 2014 In general, you want to make your code as simple and as straightforward as possible, so make sure you're not adding in unnecessary elements. From a styling perspective, it shouldn't really matter significantly. From a functionality perspective, you'll often see wrapper divs because a developer wanted to have one element that had a set width that would contain the entire site (often to center position it in the browser). Quote
kralcx Posted April 26, 2014 Report Posted April 26, 2014 Instead of using ids step up to html5. For example instead of <div id="header"> use <header>. Here are more html5 examples: <article></article> <nav></nav> <aside></aside> <section></section> <header></header> <footer></footer> <address></address> Quote
TECKSPEED Posted May 6, 2014 Author Report Posted May 6, 2014 Thank you for this, I am aware of the HTML5 upgrade, didnt realize I was doing something so dumb as to not use those tags Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.