CSS and HTML 5
Posted on March 25th, 2011
HTML 5 is supported by the majority of the big browsers and more and more sites are beginning to adopt it. Even though it’s far from being the dominant format it is gradually picking up speed as more developers try to keep up with developments. One of the main differences between HTML 5 and other versions of HTML (XHTML etc.) is the introduction of new common elements such as ‘header’, ‘nav’, ‘footer’, etc.
You’ll be glad to know that in order to start using HTML 5 you don’t really have anything new to learn as far as CSS goes. You’re able to style all of the new HTML 5 elements just like you would any other HTML element you’re used to.
Styling HTML5 elements
For example, to style the header element you’d simply have something like the following.
header
{
height: 100px;
background: #CCC;
padding: 20px;
}
Styling HTML5 elements in CSS really is that simple – it’s just what you’re used to. If you get the chance you should definitely take a look into HTML 5 and explore what it can do for you and your web sites.