hey , just wondering, im making just a quick runndown static website and using html5. but remembered that in one of my previous posts that the HTML 5 wasn't cross browser proper for me. i dont know it was mental!
but here's the code. so far
<!DOCTYPE html> <html> <head> <title>THIS IS MY WEBPAGE TITLE</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head>
<body>
<div id="wrapper">
<header> <h1>This is the website title Inside the header</h1> <p>This is the some quote or sloagen</p> </header>
<div id="main-content"> <p>This may change per page.</p> <p>This may change per page.</p> <p>This may change per page.</p> <p>This may change per page.</p> </div>
<footer> <div>This is your footer copywrite section.</div> </footer>
</div>
</body> </html>
so my real question was, should i be naming every div? (giving it an "ID" or "Class"?? if so ? howcome or why not? and is it good practice?
So, heres what the difference between classes and IDs are.
IDs are used for elements that don't repeat (ones that you only have one of) such as #footer Classes are used for repeating things such as an LI element inside of a UL.
Your code wont validate if you have more than one of the same ID on the same page.
but here's the code. so far
so my real question was, should i be naming every div? (giving it an "ID" or "Class"?? if so ? howcome
or why not?
and is it good practice?
HTML5
Also, HTML5 has so you dont have to use your #main-content div.
I usually only give main sections an ID and use classes for little things within the ID.
IDs are used for elements that don't repeat (ones that you only have one of) such as #footer
Classes are used for repeating things such as an LI element inside of a UL.
Your code wont validate if you have more than one of the same ID on the same page.
Hope that helps
do you have do give a div an ID or class?
like, is it also best practice to leave a few blank? or no