Working as a web developer often requires experimenting with new snippets. Some of your experiments will turn out to be bad (unfortunately), while others (quality pieces of code) will become staples in the website development process. In this article, you will see snippets that any web developer can use. These blocks of code include typical HTML5 templates and a few more intermediate CSS3 solutions for various site layouts. You can store these snippets in text files or in software development. But in any case, these blocks of code should prove to be a useful practice in almost any project development.
The main page of HTML5 templates
Let”s start with a very simple HTML5 web page template. This code snippet has obvious tags, document type along with some additional scripts in the header. The template contains a link to the external styles.css page for your styles.
Also included are links to 2 Google hosted scripts. First JQuery 1.8.2, which is the most recent version of the known framework at the time of publication. Then the second HTML5shiv is a useful library that allows older versions of Internet Explorer to recognize new HTML5 elements.
Clearfix for CSS wrapping (float)
Everyone learned what CSS Clearfix is a few years ago. Most web developers still don”t really understand how wrapping works. And clearfix introduces some additional rules.
You must copy the code into any CSS document where you float in your layout. The Clearfix class should be added to any wrapped container. This is useful, for example, if you have 1 or 2 sidebars and they float with your main content.CSS3 gradientsJust copy and paste these properties into any CSS selector that needs a gradient background. Then you can change the color of the value to absolutely anything, including RGBA. Internet Explorer has many customizations for creating gradients within the browser. But since many of them are not supported elsewhere, you can remove them from the working code:
HTML5 Meta Tags
The HTML structure will be built with a viewport meta tag to control the template on mobile devices.Typically mobile optimized sites contain the following commands:
HTML5 multimediaThe new video and audio tags make it much easier for developers who often work with digital media to create websites. Images have always been supported on the website, and audio and video files have struggled for decent support for a long time. Until recently, there were very few file types that can stream video on all major operating systems.