Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Summary 381

13


Elements with Their Own Outlines


Some elements are semantically understood to represent external content. The sectioning
elements nested in these kinds of elements are ignored when the document outline is pro-
duced. These elements are blockquote, details, fieldset, figure, and td.


Using HTML5 Structural Elements


As a creator of web pages, HTML5 structural elements provide a much cleaner and more
semantically useful alternative to plain old div tags for creating web pages. And these
days all modern browsers support them.


Polyfill Scripts


If you have users who are using extremely old browsers like Internet Explorer 7 or 8, you
can still use HTML5 elements, but you might need fallback options. There are scripts,
referred to as polyfills, that provide functionality found in browsers that do not support
that functionality natively.


Modernizr is one such script. It’s a JavaScript library that can be used to automatically
alter web pages and style sheets when they are loaded in Internet Explorer so that they
are displayed properly in the browser.


There are three lessons all about JavaScript starting with Lesson 17, “Introducing
JavaScript.” JavaScript is a programming language that browsers understand how to
interpret and execute. You can load JavaScript libraries on your web pages in basically
the same way you load external style sheets. You can also embed JavaScript in your
pages using the script tag.


You need to download Modernizr to use it. You can get it from the website at
http://modernizr.com/download/. For performance reasons, you can create a custom build
that includes the features that you need, but it’s easiest to start by downloading the whole
thing.


Explaining how Modernizr works is beyond the scope of this lesson, but if you need to
support older browsers with specific HTML5 features, you can use Modernizr to ensure
that users of older browsers see an equivalent experience when they use your page.


Summary


HTML5 provides a new set of tags that enable you to structure pages using tags that pro-
vide sematic meaning about the page, rather than just

tags. Not only do these tags
describe the structure of a page, but they also enable you to clearly differentiate between

Free download pdf