Text Formatting with HTML
Developing web pages in HTML5 markup language using CSS3 cascading style sheets (CSS)
Additional materials
Text Formatting with HTML
Block and Inline Tags
Tags
Tag assignment
body
Document body
h1- h6
Header tags
p
Paragraph
div
Content block
address
Address
article
Article
aside
Side column
nav
Navigation on the page
main
The main content of the web page
header
The top of the page or section
footer
The bottom of the page, section or block quotation
section
Page section
audio
Insert audio
video
Insert video
blockquote
Block quotation
caption
Table header
colgroup
Defines the column group of a table
table
Table
thead, tbody, tfoot
To select row groups of a table
form
To create a form
datalist
Content for filling out the form field
select
Drop-down list
fieldset
Form field group
legend
Header for fieldset
dl, ul, ol
List tags
canvas
To draw graphics using JavaScript
details
To create an interactive element
summary
The visible part of the text of the details element
figure
The wrapper for the <img> element
figcaption
The header for the <figure> tag
map
Interactive map
iframe
Container for loading the contents of another html-page
pre
Preformatted text
progress
Progress indicator
Tags
Tag assignment
abbr
Abbreviation
b, strong
Bold text
i, em
Italic text
dfn
Definition
Br
Line break
button, input, textarea,
The button, the text field and the text area — the form elements
label
Label for the form element
cite
Title of work, reference to source
code
To highlight program code
kbd
Code input from the keyboard
samp
An example of outputting something in a computer program
var
Variable in any program
col
Column in the table
del
Text that has been deleted
ins
The text that was added (often follow the <del> tag)
S
Strikethrough text, i.e. text that is not already correct or reliable. It's better to use the <del>
span
Container for css-formatting of a certain amount of text
sub
Subscript (H2O)
sup
Superscript (x2)
small
Smaller text
img
Inserting images
mark
Highlighted text
meter
Horizontal meter
q
Short quote
- Block tags;
- Inline tags.
Tags of physical and logical formatting
- Wikipedia — https://en.wikipedia.org/wiki/Search_engine_optimization;
- Google for web-masters — https://www.google.com/intl/en/webmasters/learn/.
Deprecated tags and attributes
<!DOCTYPE html>
Character Entities in HTML. Using Them in an HTML Page
Copyright or Trademark Signs
Using spaces and hyphens
Rec&shy;om&shy;men&shy;da&shy;tion
<html lang="ru"> ... <style> .hyphens { -moz-hyphens: auto; -ms-hyphens: auto; -webkit-hyphens: auto; hyphens: auto; } </style>
- -moz- for Mozilla FireFox;
- -ms- for Internet Explorer;
- -webkit- for Safari, Chrome, and other browsers based on Chromium — the Chrome engine.
The Use of Entities
code { white-space: pre; }
CSS properties for text formatting
white-space: normal | nowrap | pre | pre-line | pre-wrap
- The nowrap value does not take into account the spaces and line breaks in the HTML code, and all text is displayed as one line. In this case, a horizontal scroll bar can be added if the text does not fit the width of the parent container. Only adding the tag <br> moves the text to a new line.
- The pre value displays the text with all the spaces, tabs, and hyphenations that are present in the HTML code. For a too long line a horizontal scroll bar will be added in the browser.
- The pre-line value does not take into account the spaces, and the text itself will be moved to the next line if it does not fit into the parent container.
- The pre-wrap value saves all the spaces and hyphens that were in the text editor, but if the line does not fit the width of the parent container, the text will automatically be moved to the next line.
word-break: normal | break-all | keep-all
- The normal value (default) hyphenates the whole word when it reaches the right edge of the parent block.
- The break-all value adds line breaking so that the word fits into the given width of the parent block (cannot be used for text in Chinese, Korean or Japanese).
- The keep-all value prevents the line breaking for text in Chinese, Korean or Japanese. For other languages, it corresponds to normal.
word-wrap: normal | break-word
- The normal value (default) wraps the whole word when it reaches the right edge of the parent block or in places where the <br> tag is added inside the text.
- The break-word value adds the line breaking so that the word fits into the specified width of the parent block.
writing-mode: horizontal-tb | vertical-rl | vertical-lr
- The value horizontal-tb determines the direction of the text horizontally from top to bottom and from left to right.
- The value vertical-rl determines the direction of the text vertically from top to bottom and from right to left.
- The value vertical-lr determines the direction of the text vertically from top to bottom and from left to right.
word-spacing: number in px, pt, em, but not in %| normal
letter-spacing: number in px, pt, em, but not in %| normal
.lettering {letter-spacing: 6px;}
text-transform: capitalize | lowercase | uppercase | none
text-transform: underline | line-through | overline | none
text-decoration: text-decoration-line | text-decoration-style | text-decoration-color
text-decoration-line: line-through | overline | underline | none
text-decoration-style: solid | double | dotted | dashed | wavy
- solid — solid single line;
- double — double line;
- dotted — dotted line;
- dashed — dashed line;
- wavy — wavy line.
text-shadow: none | offXoffY blur color
text-shadow: offX1 offY1 blur1 color1, offX2 offY2 blur2 color2, offX3 offY3 blur3 color3;
Home Assignment
article { width: 90%; margin: auto; }
© STEP IT Academy, itstep.org
All the copyrighted photos, audio, and video works, fragments of which are used in the material, are the property of their respective owners. Fragments of the works are used for illustrative purposes to the extent justified by the objective, within the educational process, and for educational purposes, in accordance with the Act of “On Copyright and Related Rights”. The scope and method of the cited works are in accordance with the adopted norms, without prejudice to the normal exploitation of copyright, and do not prejudice the legitimate interests of authors and right holders. At the time of use, the cited works fragments cannot be replaced by alternative, non-copyrighted counterparts and meet the criteria for fair use. All rights reserved. Any reproduction of the materials or its part is prohibited. Use of the works or their fragments must be agreed upon with authors and rights holders. Agreed material use is only possible with reference to the source. Responsibility for unauthorized copying and commercial use of the material is determined by the current legislation.