HTML Formatting

HTML formatting

HTML formatting

HTML (Hypertext Markup Language) is a markup language used to create and structure content for the web. HTML allows you to format text, add images, and create links, among other things. Here are some basic HTML formatting elements:

  1. Headings: HTML provides six levels of headings (h1-h6) to structure content. For example:
				
					<h1>This is a heading level 1</h1>
 <h2>This is a heading level 2</h2> 
 <h3>This is a heading level 3</h3> 

				
			
  1. Paragraphs: Use the <p> tag to indicate a new paragraph:
				
					<p>This is a paragraph of text.</p> 
<p>This is another paragraph of text.</p> 

				
			
  1. Bold and Italics: Use the <b> tag to make text bold and the <i> tag to make text italic:
				
					<p>This is <b>bold</b> text.</p> 
<p>This is <i>italic</i> text.</p> 

				
			
  1. Lists: HTML provides two types of lists – ordered lists (<ol>) and unordered lists (<ul>). Use the <li> tag to create list items:
				
					<h3>Ordered List:</h3> 
<ol> 
        <li>List item 1</li> 
        <li>List item 2</li> 
        <li>List item 3</li>
 </ol> 
<h3>Unordered List:</h3>
 <ul>
       <li>List item 1</li> 
       <li>List item 2</li> 
       <li>List item 3</li> 
</ul> 

				
			
  1. Links: Use the <a> tag to create links:
				
					<p>Visit <a href="https://www.example.com/" target="_blank" rel="noopener">Example</a> for more information.</p> 
				
			
  1. Images:
				
					<img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" alt="A description of the image" data-lazy-src="image.jpg"><noscript><img decoding="async" src="image.jpg" alt="A description of the image"></noscript>
				
			
  1. Tables:
				
					<table>
  <thead>
    <tr>
      <th>Column 1</th>
      <th>Column 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Row 1, Column 1</td>
      <td>Row 1, Column 2</td>
    </tr>
    <tr>
      <td>Row 2, Column 1</td>
      <td>Row 2, Column 2</td>
    </tr>
  </tbody>
</table>

				
			

8 .Underlined text :To create underlined text in HTML, you can use the <u> tag. Here’s an example:

				
					<p>This is <u>underlined</u> text.</p> 
				
			

In the above example, the word “underlined” will be displayed with a line underneath it.

However, it’s important to note that using underlined text for regular content is generally not recommended, as it can be confused with hyperlinks, which are typically underlined in many web browsers by default. Instead, it’s better to use other formatting options such as bold, italics, or color to emphasize text.

9.Strike Text:  To create strikethrough text in HTML, you can use the <strike> tag or the <s> tag. Here’s an example:

				
					<p>This text is <strike>strikethrough</strike> or <s>crossed out</s>.</p> 
				
			

In the above example, the word “strikethrough” or “crossed out” will be displayed with a line through it.

However, it’s important to note that the <strike> tag is deprecated in HTML5, and it’s recommended to use the <s> tag instead. Additionally, it’s important to use strikethrough text sparingly, as it can be difficult to read and can make your content appear cluttered or unprofessional.

10.Subscripted Text :To create subscripted text in HTML, you can use the <sub> tag. Here’s an example:

				
					<p>This is subscripted text: H<sub>2</sub>O</p> 
				
			

In the above example, the number “2” will be displayed as subscripted text.

Subscripted text is commonly used in scientific or mathematical contexts, such as in chemical formulas, mathematical equations, or footnotes.

11.Smaller Text:To create smaller text in HTML, you can use the <small> tag. Here’s an example:

				
					<p>This is <small>smaller text</small>.</p> 
				
			

In the above example, the words “smaller text” will be displayed in a smaller font size.

The <small> tag is typically used to indicate secondary information or disclaimers that are less important than the main content. However, it’s important to use the <small> tag appropriately and sparingly, as excessively small text can be difficult to read and can negatively affect the user experience.

         12.Larger Text:To create larger text in HTML, you can use the <big> tag. Here’s an example:

				
					<p>This is <big>larger text</big>.</p> 
				
			

In the above example, the words “larger text” will be displayed in a larger font size.

However, it’s important to note that the <big> tag is deprecated in HTML5, and it’s recommended to use CSS to style text instead. You can use CSS to specify a larger font size for a specific element by using the font-size property, like this:

				
					<p style="font-size: larger;">This is larger text using CSS.</p> 
				
			

In this example, the style attribute is used to apply the font-size property to the <p> element and set the font size to “larger”.

Join To Get Our Newsletter
Spread the love