html.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 27 May 2016 11:06:56 +0300
changeset 1967 e852e900a724
parent 1966 5f7b046c246e
child 1978 2e9097b2426d
permissions -rw-r--r--
Page or text language.

.. -*- coding: utf-8; -*-

=======
 HTML.
=======
.. contents::
   :local:

Disable quirk mode.
===================
::

  <!DOCTYPE HTML>

Page encoding
=============

Place in HEAD tag (CHARSET is one among of defined by
http://www.iana.org/assignments/character-sets)::

  <meta http-equiv="Content-Type" content="text/html; charset=CHARSET">

or in HTML 5::

  <meta charset="utf-8">

See:

  http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2

Page or text language
=====================

Client may suggest preferred language to server via ``Accept-Language`` HTTP
tag::

  Accept-Language: da, en-gb;q=0.8, en;q=0.7

W3C best practice suggest to surround corresponding text pieces in tag with
``lang`` attribute. Attribute values are from BCP 47.

http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
  IANA registered language and country codes. Coherent with ISO codes but
  frequently updates.
http://www.ietf.org/rfc/bcp/bcp47.txt
  Tags for Identifying Languages (Best Current Practice).
https://www.w3.org/International/articles/language-tags/
  Language tags in HTML and XML.
https://www.w3.org/International/questions/qa-html-language-declarations
  Declaring language in HTML.
https://www.w3.org/International/questions/qa-lang-why
  Why use the language attribute?

Center an object.
=================

To center block-level element::

  <div style="margin-left: auto; margin-right: auto; position: relative; width: 700px;">
    <div>SOME</div>
  </div>

To center inline element::

  <p style="text-align: center;">TEXT</p>

Browser support.
================

  * http://htmlbook.ru/
  * http://www.quirksmode.org/