HTML5 Solutions: Essential Techniques for HTML5 Developers
HTML5 brings the biggest changes to HTML in years. Web designers
now have new techniques, from displaying video and audio natively in HTML,
to creating realtime graphics on a web page without a plugin.
This book provides a collection of solutions to all of the most common HTML5 problems.
Every solution contains sample code that is production-ready and can be applied to any project.
How to Use a CSS ID Selector
A CSS id selector, which uses the pound sign (#), can be used to select one, and only one
html element on a webpage (the element with its id attribute set to the same name
as the name after the Id selector). Shown below is html code for a div with its id
attribute set to "appbtn".
<div id="appbtn">This box was styled by the id selector #appbtn</div>
The id for an html element cannot begin with a number or a hyphen followed by a number.
The id cannot contain spaces, and the only punctuation characters allowed are the hyphen
(-) and the underscore (_).
Shown below is a CSS declaration block that uses the id selector to select and apply style
rules to the element with its id attribute set to "appbtn".
box-shadow: 6px 6px 4px #a0a0a0;
Note: If you need to apply the same set of style rules to multiple html elements, even to
dissimilar elements, you should use a class selector. The class selector uses a dot (.)
in front of the name instead of a pound sign, and the html element to receive the class
used the class attribute rather than the id attribute.
Web Design Sections
This book is an essential technical dictionary for professional web designers and developers,
conveniently summarizing over 3000 pages of (X)HTML5 and CSS3 specifications and covering the
most common and fundamental concepts and specs, including tags, attributes, values, objects,
properties, methods, events, and APIs.
Web Designer Manu Gautrand says,"It's easy to find what you are looking for and most tags⁄properties
have good code examples and specify in what browser versions the tag is supported.
Click here for more information.