< Back to Usualdosage.com

The UsualDosage Presents: HTML5

This page is provided as a short demonstration of the capabilities of HTML5, Javascript and CSS3.0. You are free to download and and use any of the source files contained in this demonstration.

Site Design Notes

Rounded corners are generated using the border-radius and -moz-border-radius styles in CSS3. Drop shadows on the rounded panels are achieved through the use of the box-shadow attribute.

                .roundedPanel 
                { 
                    background-color: #fff; 
                    width: 800px; 
                    margin-left: auto; 
                    margin-right: auto; 
                    border: solid 1px #666; 
                    border-radius: 5px; 
                    -moz-border-radius: 5px; 
                    padding: 10px; 
                    box-shadow: 3px 3px 7px #777; 
                } 
            

The styled fonts used on this site are handled by the @font-face selector in CSS3. The fonts are loaded locally from .OTF and .TTF font types, which are available from the links below.

                @font-face
                {
                    font-family: 'Lobster Two';
                    src: url(../resources/LobsterTwo-Regular.otf);
                }
                @font-face
                {
                    font-family: 'Capsuula';
                    src: url(../resources/Capsuula.ttf);
                }
                h1
                {
                    font-family: Lobster Two;
                    border-bottom: solid 1px #666;
                }
            

Gradient backgrounds used throughout this page are achieved by using various background gradient styling elements. Example CSS code is below:

                background: #e6f4f4;
                background: 
                    -moz-linear-gradient(top, #eeeeee 1%, #ffffff 100%);
                background: 
                    -webkit-gradient(linear, left top, left bottom, 
                    color-stop(1%,#eeeeee), color-stop(100%,#ffffff));
                background: 
                    -webkit-linear-gradient(top, #eeeeee 1%,#ffffff 100%);
                background: 
                    -o-linear-gradient(top, #eeeeee 1%,#ffffff 100%);
                background: 
                    -ms-linear-gradient(top, #eeeeee 1%,#ffffff 100%);
                filter: progid:DXImageTransform.Microsoft.gradient(
                    startColorstr='#eeeeee', 
                    endColorstr='#ffffff',GradientType=0 );
                background: linear-gradient(top, #eeeeee 1%,#ffffff 100%);
            

This site makes extensive use of several external javascript files, all of which are available free for download below.

Controls

HTML5 provides a new set of native controls that make data entry and form validation much easier for web developers and users alike. Below are three examples.

AutocompleteBegin typing a color
Search Input
Regular Expression Input

Geolocation Demo

The HTML5 geolocation API lets you share your location with trusted web sites. The latitude and longitude are available to JavaScript on the page, which in turn can send it back to the remote web server and do location-aware things like finding local businesses or showing your location on a map. Click "Show Current Position" below to see a demonstration of how this works.

map