Three developers, Bob, Bill, and Bruno start building a website, and they start arguing about which way to write HTML markup (and CSS) is best.
All Doctypes = <!doctype html>
Bob writes his markup as follows:
<style type=text/css media=screen>
#container {
background-image: url(http://goo.gl/qJKWj);
}
</style>
<div id=container>
<div id=header>...</div>
<div id=content>...</div>
<div id=footer>...</div>
</div>
Bill writes his markup as follows:
<style type="text/css" media="screen">
#container {
background-image: url("http://goo.gl/qJKWj");
}
</style>
<div id="container">
<div id="header">...</div>
<div id="content">...</div>
<div id="footer">...</div>
</div>
Bruno writes his markup as follows:
<style type="text/css" media="screen">
#container {
background-image: url('http://goo.gl/qJKWj');
}
</style>
<div id="container">
<div id='header'>...</div>
<div id='content'>...</div>
<div id='footer'>...</div>
</div>
As we can see:
Bob does not like to attach attribute values with quotation marks of any kind.
Bill likes to use double quotes.
Bruno sometimes uses quotes, and sometimes does not.
They came to me for advice on how the above examples are best for performance and which are easier on the eyes. Is there a difference between them, apart from cosmetic reasons?
What should I tell them?
source
share