Web Design with HTML and CSS

(National Geographic (Little) Kids) #1

262


HTML5 markup is still evolving

Web Design with HTML and CSS Digital Classroom

Identifying fi gures and captions


The <fi gure> element identifi es diagrams, illustrations, and photos used within an article, and
the <fi gurecaption> element identifi es the captions that are often paired with these fi gures.
<fi gure><img src=”blue_strawberry_smoothie.jpg” alt=”Blueberry &
Strawberry Smoothie”>
<fi gcaption>A fresh blueberry and strawberry smoothie</fi gcaption>
</fi gure>

The fi gure element in HTML5 provides
semantic tags to help identify images and
their captions.

Web forms


The new form elements in HTML, when implemented, will make working with forms quite
easily. For example, a common goal of many web designers is to create forms that require
validation before the data is submitted. For example, a user must enter a value in the email
fi eld for a form submission to be successful. Currently, most solutions to this problem require
JavaScript or another scripting language. HTML5 simply adds the required attribute to the list
of form input types, as shown below:
<input type="email" required>
There are many new form input types, such as email (specifi cally designed for e-mail addresses),
search (to designate form fi elds used with search terms), and url (to specify a form fi eld that
uses a web address). These new web form elements will take some time to become part of the
offi cial specifi cation, but they are designed to fall back to generic input forms. In other words,
you can use these new input types today, and if a browser doesn’t support them, the new form
element will use a generic (supported) element.
Free download pdf