The DTD mentioned at the beginning of the WWW document is an XML tag that defines the type of markup language used in the following document (e.g., HTML 4.01, XHTML 1.1, or HTML5). Its purpose is to prevent formatting the document according to an incompatible specification (for which the document was not created).
For more details on DTD, see:
- http://www.jakpsatweb.cz/doctype.html (before HTML5)
- http://www.sovavsiti.cz/c01043.html (before HTML5)
- http://www.wellstyled.com/html-doctype-and-browser-mode.html (before HTML5)
- http://www.kosek.cz/clanky/xml/xml-01.html (general)
or for information equivalent to HTTP headers (not reliable)
```html
<meta http-equiv="info_type" content="info_content">
```
## Most Commonly Used Tags in HTML
| tag | meaning | paired? |
|--------|--------|
| html | entire document | yes |
| head | document header | yes |
| title | page title (in the header) | yes |
| body | document body | yes |
| a | hypertext link | yes |
| h1 | highest-level heading (e.g., 6 levels) | yes |
| p | paragraph | optionally |
| br | (!) line break (carriage return) | no |
| em | text emphasis | yes |
| strong | strong text emphasis ("bold") | yes |
| img | image | no |
| hr | horizontal line | no |
| div | (!) division (part of the document) | |
| span | (!) text segment | yes |
And also tags for creating lists (`ul`, `ol` + `li`; `dl` + `dt`, `dd`), forms (see [Forms](#31)), or tables (`table`, `tr`, `th`, `td`, ...).
---
## Unsupported Tags and Attributes in HTML5
HTML5 has removed elements (tags and attributes) that mimicked the functionality of cascading styles.
HTML5 does not support tags like: `basefont`, `dir`, `font`, `big`, `center`, `strike`, `tt`, `acronym`, `applet`, ...
HTML5 does not support attributes like:
- `<body>`: `text`, `bgcolor`, `link`, `alink`, `vlink`, `background`
- `<hr>`: `align`, `noshade`, `size`, `width`
- `<a>`: `name` (use `id` instead)
- `<table>`: `cellspacing`, `cellpadding`
- "general" attributes: `align`, `valign`, `border`, `width`, `height`, `bgcolor`, `hspace`, and `vspace`
For details, see https://www.w3schools.com/tags/default.asp
---
## New Tags in HTML5
HTML5 introduces new tags for a more precise description of document content (semantic tags replacing the general `div` tag):
- `header` – page header or header of a page section
- `footer` – page footer or footer of a page section
- `nav` – navigation area (entire page or its sections)
- `section` – logical area of the page (e.g., one _slide_ of this presentation)
- `article` – article or complete content section
- `aside` – side note (secondary content related to the article!)
- `meter` – describes the degree within a range (e.g., how much money is in the collection)
- `progress` – displays the real-time progress relative to the goal (e.g., how much data has been transferred to the server so far)
Browsers support these tags from around 2015.
---
## New Attributes in HTML5
HTML5 adds attributes for creating user-friendly forms (autofocus, placeholder, and contenteditable) and new values for the `type` attribute of the `input` tag (email, url, search, range, tel, number, color, date, month, week, time, datetime-local).
HTML5 allows users to use custom data attributes starting with the `data-` prefix (the W3 validator ignores them). They can be used with any tag, and JavaScript can access them. They have many uses (e.g., displaying the date and time in the user's time zone; determining whether to process the form using AJAX; adding presentation information to the document structure when it cannot be done using CSS – e.g., the size of the JavaScript-opened window with a tooltip).
New data attributes (including `data-`) are supported by browsers released after 2015. If a browser does not understand an attribute, it ignores it.
---
See also [webtvorba.cz](http://www.webtvorba.cz/xhtml/html-entity.html), [jakpsatweb.cz](https://www.jakpsatweb.cz/html/entity.html).
---
## Form Creation I
Forms are used to enter data (by the user), which will then be processed in some way (by a client or server script). Each form is enclosed in a paired [`form`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) tag, whose attributes primarily determine how the data will be sent to the server (`method`) and which script will process the data (`action`):
```html
<form action="some URL" method="post">...</form>
```
__Note:__ instead of the `post` method, you can use `get` (explained later).
Inside the form, individual elements are defined – according to the type of information the user needs to enter (e.g., [`input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), [`select`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) – see below).
It is advisable to use the [`label`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label), [`legend`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend), [`fieldset`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/
- `label` – associates a text label with a form element
- `legend` – caption for the `fieldset` element
- `fieldset` – groups related form elements
- `optgroup` – groups related options in a `select` element
---
## Form Creation II
Elements that can be defined inside a form:
- "single-line" form element [`input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) (unpaired tag) with various types: `text` for text input, `password` for password input, `radio` for selecting one of the options, `checkbox` for a "checkbox", `submit` for submitting the completed form, `file` for uploading a file (+ spec. attribute for `form`), `hidden` for a hidden element, and other types from HTML5 (e.g., `email`)
- multi-line text [`textarea`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) (paired tag)
- selection list ("menu") [`select`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) (paired tag), whose elements are placed in optionally paired `option`
__All elements must have the `name` attribute specified, otherwise, they cannot be processed!__
For an overview of tags, see, e.g., [w3schools](https://www.w3schools.com/html/html_forms.asp) or [JakPsatWeb](https://www.jakpsatweb.cz/html/formulare.html).
- [pristupnost.cz](http://www.pristupnost.cz/) (Dobrý web project)
- [for website creators](http://www.pristupnost.cz/jak-tvorit-pristupny-web/pro-tvurce-webu/)
- [tutorials](http://blindfriendly.cz/tutorialy) (Blind Friendly Web project)
---
## Web Content II
Further advice on content:
- [How to Write Texts on the Internet](https://www.jakpsatweb.cz/jak-psat.html) (jakpsatweb.cz)
- [Content / Form](https://www.jakpsatweb.cz/obsah-forma.html) (jakpsatweb.cz)
- [How to Use Headings](http://www.sovavsiti.cz/c01201.html) (sovavsiti.cz)
- [How to Write Headings](http://www.sovavsiti.cz/c01212.html) (sovavsiti.cz)
- [How to Turn Users into Readers](https://www.interval.cz/clanky/piseme-pro-web-jak-udelat-z-uzivatelu-ctenare/) (interval.cz)
<br/>
__Recommendation:__ back up your pages in case of server failure and data loss, or "encounter" with computer hackers. Always keep multiple copies of your web pages.
---
## Search Engine Optimization (SEO)
Optimizing for search engines (Google, Seznam, etc.)
Basic principles:
- use a meaningful title (`title`),
- use `meta` tags to define page description, keywords, information for search engine robots,
- _text_ of the page should be of high quality, short, meaningful, structured, regularly updated; the code must be _valid_ and should not contain unnecessary tags (tags),
- _appearance_ should be pleasant, fast, and optimized for search engines (e.g., using keywords in the text, meta tags, etc.),
- _links_ should be from quality sources and relevant to the page content.
---
## Search Engine Optimization (SEO) – Books
- Linhart, Jan; Kubíček, Michal. 333 Tips and Tricks for SEO. Brno: Computer Press, 2010.
- Kubíček, Michal. The Big SEO Guide. How to Achieve the Best Positions in Search Engines. Brno: Computer Press, 2008.
- Couzin, Gradiva; Grappone, Jennifer. SEO – Search Engine Optimization: Optimization for Search Engines. Prague: ZONER Press, 2008.
- Smička, Radim. Search Engine Optimization – SEO. Dubany: Jaroslava Smičková, 2004. Also available at http://seo.jasminka.cz/.
- King, Andrew B. Speed Up Your WWW Pages. Prague: ZONER Press, 2004.