Solving common tasks
Having mastered the template basics, you will soon need to solve some common tasks. You will learn about the most common ones in the following sections.
Configuring the document type
The document type at the beginning of a page tells the browser how to render the page. All the previous examples used the doctype
shortcut of HTML 5: <!DOCTYPE html>
. If you need a different document type, then you have to choose between either using the built-in doctypes
or custom doctypes
. The following shortcuts are available:
Shortcut |
Generated DOCTYPE |
---|---|
doctype html |
<!DOCTYPE html> |
doctype xml |
<?xml version="1.0" encoding="utf-8" ?> |
doctype transitional |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
doctype strict |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"... |