HTML text formatting

This text is bold

This text is italic

This is computer output

This is subscript and superscript


HTML formatting tags

HTML uses the tags <b> and <i> to format the output text, such as bold or italic
These HTML tags are called formatted tabs (see the bottom full label reference manual).
Usually <strong> replace the bold label <b> to use the <em> replace <i> tag to use.

However, the meaning of these tags is different: 

<b> and <i> define bold or italic text. 

<Strong> or <em> means that the text you want to render is important, so highlight it. Now all the major browsers can render various effects of the font. However, future browsers may support better rendering.


HTML text formatting tags

Tagdescription
<b>Define bold text
<em>Define the focus text
<i>Defines italics
<small>Defines the trumpet word
<strong>Define your tone
<sub>Defines the subscript word
<sup>Defines the upper mark
<ins>Defines the insertion word
<del>Defines the deleted word

HTML "Computer Output" tab

Tagdescription
<code>Defines the computer code
<kbd>Defines the keyboard code
<samp>Defines the computer code sample
<var>Defines the variable
<pre>Defines preformat text

HTML citations, references, and tag definitions

Tagdescription
<abbr>Define abbreviations
<address>Defines the address
<bdo>Defines the direction of the text
<blockquote>defines long references
<q>Define short quotes
<cite>Defines references, citations
<dfn>Defines a defined item.

[right-side]

HTML can divide a document into paragraphs.

HTML paragraph

Paragraphs are defined by the <p> tag.

Examples

<p>This is a paragraph </p>
<p>This is another paragraph</p>
Note: The browser will automatically add blank lines before and after the paragraph. (</ P> is a block-level element)

Do not forget to end the label

Even if you forget to use the end tag, most browsers will correctly display the HTML:

Examples

<p>This is a paragraph
<p>This is another paragraph
The above example is no problem in most browsers, but do not rely on this approach. Forgetting to use the end tag will produce unexpected results and errors.
Note: In future versions of HTML, the end tag is not allowed to be omitted.

HTML fold

If you want to wrap (newline) without generating a new paragraph, use the <br /> tag:

Examples

<p>This is<br>a para<br>graph with line breaks</p>
The element is an empty HTML element. Since closing the label does not make any sense, it does not end the tag.

HTML output - use reminder

We can not determine the exact effect HTML has shown. The size of the screen, as well as the adjustment of the window may lead to different results.
For HTML, you can not change the output by adding extra spaces or line feeds to the HTML code.
When the page is displayed, the browser removes the extra spaces and blank lines from the source code . All consecutive spaces or blank lines are counted as a space. It should be noted that all consecutive blank lines (newlines) in the HTML code are also displayed as a space.
(This example demonstrates some HTML formatting issues)

HTML tag reference manual

The self-enhanced school's reference manual provides more information about HTML elements and their attributes.
labeldescription
<p>Define a paragraph
<br>Insert a single line (line feed)

[right-side]

In HTML documents, the title is important.

HTML title

Heading is defined by the <h1> - <h6> tag.
<H1> Defines the largest title. <H6> Defines the smallest title.

Examples

<h1> This is a title. </ h1>
<h2> This is a title. </ h2>
<h3> This is a title. </ h3>
Note: The browser will automatically add blank lines before and after the title.

The title is important

Make sure to use the HTML heading tag only for the title. Do not just use the title in order to generate bold or text.
The search engine uses the title to index the structure and content of your page.
Because the user can quickly navigate through your page through the title, it is important to use the title to render the document structure.
H1 should be used as the main title (the most important), followed by h2 (sub-important), followed by h3, and so on.

HTML Horizontal Line

The <hr> tag creates a horizontal line in the HTML page. 

Hr elements can be used to separate content.

Examples

<p>This is a passage.</p>
<hr>
<p>This is a passage.</p>
<hr>
<p>This is a passage.</p>


HTML comments

You can insert comments into HTML code, which improves readability and makes your code easier to understand. Browsers ignore comments and do not display them.
The comment is as follows:

Examples

<!-- This is a comment -->
Note: After the start of the brackets (the brackets on the left) need to follow an exclamation mark, before the closing brackets (right parentheses) do not need to use the annotation to help the future code editing work. The

HTML tips - how to view the source code

Whether you have seen some pages and then wonder how it is achieved.
If you want to find the mystery, just right click and select "View Source" (IE) or "View Page Source" (Firefox), and other browsers are similar. Doing so will open a window containing the page HTML code.


HTML tag reference manual

The self-enhanced school's reference manual provides more information about these titles and their attributes.
You will learn more about HTML tags and attributes in the following sections of this tutorial.
labeldescription
<html>Define an HTML document
<body>Define the subject of the document
<h1> to <h6>Define the HTML title
<hr>Define the horizontal line
<!-->Define a comment

[right-side]

Attributes are additional information provided by HTML elements.

HTML attributes

  • HTML elements can set properties
  • Properties can be added in the element additional information about an element
  • Attributes are generally described in the start tag
  • Attributes are always in the form of name / value pairs, such as: name = "value" .

Attribute instance

The HTML link is defined by the <a> tag. The address of the link is specified in the href attribute :

Examples

<a href="http://chandrasaena.blogspot.in">This is a link</a>



HTML attributes are commonly used to reference attribute values

The attribute value should always be enclosed in quotation marks.
Double quotation marks are the most commonly used, but there is no problem with single quotation marks. In some individual cases, such as the attribute value itself contains double quotation marks, then you must use single quotation marks, for example:
Tip: In some individual cases, such as the attribute value itself contains double quotation marks, then you must use single quotation marks, for example: name = 'John "ShotGun" Nelson'

HTML Tip: Use lowercase properties

Attributes and attribute values ​​are not case sensitive.
However, the World Wide Web Consortium recommends lowercase attribute / attribute values ​​in its HTML 4 recommendation.
While the new version of (X) HTML requires the use of lowercase properties.

HTML Property Reference Manual

View the complete list of HTML attributes: HTML Tag Reference Manual .
Here are the attributes that apply to most HTML elements:
Attributesdescription
classDefine one or more class names (class name) from the style file for the html element
idDefines the unique id of the element
styleSpecifies the inline style of the element title text specifies additional information for the element (can be displayed in the tooltip)
titleDescribes the extra information of the element (used as a toolbar)
More Standard Attributes Description: HTML Standard Properties Reference Manual .

[right-side]

Chandrasaena

Powered by Blogger.