Web Design Services | Web Development | Mobile Application

What are HTML basic tags

Skeletal Tags

Skeletal tags refer to small, benign growths of bone that can appear on the skull or other bones in the body. These tags are usually harmless and do not cause any symptoms. However, they can sometimes become irritated or painful if they rub against clothing or jewelry. Skeletal tags are typically diagnosed through X-ray imaging, and they can be removed surgically if they cause discomfort or are cosmetically displeasing.

Heading Tags

Heading tags, also known as HTML heading tags, are used to organize and structure text content on a website. They are used to indicate the importance and hierarchy of different sections of text, with the highest-level headings (H1) being the most important and the lowest-level headings (H6) being the least important. Proper use of heading tags can improve the accessibility and readability of a website for both users and search engines. Examples of heading tags are <h1> <h2> <h3> etc. It is important to note that it is generally recommended to use only one H1 heading per page as it is usually reserved for the title of the page.

Paragraph Tag

The paragraph tag, also known as the <p> tag, is used in HTML to indicate a block of text that represents a standalone paragraph. It is used to separate text into distinct sections and to create structure and organization on a website. The <p> tag is an open and close tag and any text between the opening and closing tags is considered a paragraph.

For example:<p>This is a paragraph of text. It is enclosed within the opening and closing paragraph tags.</p>

The <p> tag is also used to apply CSS styles to the paragraph, such as font size, color, and alignment. Additionally, it’s important to note that the default margin and padding of <p> tag are automatically added to the top and bottom of the element. This is helpful in providing structure and clarity on the webpage.

Horizontal Line Tag

The horizontal line tag, also known as the <hr> tag, is used in HTML to create a horizontal line that can be used to separate sections of content or create visual breaks on a website. The <hr> tag is a self-closing tag and does not require a closing tag.

For example:<hr>

This will create a horizontal line that spans the entire width of the containing element.

You can also use the <hr> tag with CSS to change the appearance of the horizontal line, such as its color, width, and style. By adding different properties you can control the thickness of the line, add a color, and make the line dotted,dashed, or double-lined for example.

For example:<hr style=”border: 2px solid red;”>

This will create a red, 2-pixel thick solid horizontal line.

It is important to note that the <hr> tag should be used only to separate sections of content and not to create spacing or visual effects.

Line Break Tag

The line break tag, also known as the <br> tag, is used in HTML to insert a line break between words or phrases within a block of text. It is a self-closing tag and does not require a closing tag.

For example, This is some text <br> This text is on the next line.

This will create a line break between the two phrases, resulting in the second phrase appearing on the next line below the first.

It’s important to note that the <br> tag does not add any extra white space to the text, it only separates the text in a new line. If you want to add extra space between the lines you should use padding, margin or CSS.

For example:<p style=”margin-bottom:20px”>This is some text <br> This text is on the next line with 20 pixels space.</p>

This will create a line break between the two phrases, and also add a 20 pixels space below the text.

It is important to note that it is considered a best practice to use <br> tag sparingly and only when necessary, as too many line breaks can create cluttered and difficult-to-read content.

Center Tag

The center tag, also known as the <center> tag, is used in HTML to center elements horizontally within a container. It is an open and close tag and all elements placed within the opening and closing center tags will be centered horizontally on the page.

For example:<center> <img src=”image.jpg” alt=”image”> </center>

This will center the image horizontally within its container.

It’s important to note that the <center> tag has been deprecated in HTML5, and it is no longer supported by most web browsers. Instead, it is recommended to use CSS to center elements on a page, by using “text-align” or “margin” properties.

For example:<div style=”text-align:center;”> <img src=”image.jpg” alt=”image”> </div>

This will center the image horizontally within its container by using CSS.

Using CSS to center elements will give you more control over how your elements look, and it’s more flexible than using <center> tag. Additionally, using CSS will ensure your website will be more accessible and compatible with different devices and web browsers.

Preserve Formatting Tag

The preserve formatting tag, also known as the <pre> tag, is used in HTML to preserve the formatting of text as it was written in the source code. The <pre> tag is an open and close tag and any text between the opening and closing tags will be displayed with the same spacing, line breaks, and font as it appears in the source code.

For example:<pre> This is some text that will be displayed with the same formatting as it appears in the source code. </pre>

This will display the text with the same line breaks and spacing as they are in the source code.

It’s important to note that using <pre> tag may affect the accessibility of the website because this tag tends to preserve the line breaks, spaces, and fonts, which makes the content hard to read especially when it’s used with smaller screens.

It is recommended to use <pre> tag only when it’s necessary to preserve the formatting of the code and use CSS to control the font and spacing of the text. Also, it is recommended to use <code> tag to include code snippets within a <pre> element.

For example:<pre><code> This is some code snippet that will be displayed with the same formatting as it appears in the source code. </code></pre>

This will display the code snippet with the same line breaks and spacing as they are in the source code, and it will be semantically correct, and accessible.

In conclusion, <pre> tag can be useful when it’s necessary to preserve the formatting of the text, however, it’s important to use it sparingly and use CSS to control the font and spacing of the text.

Share:

More Posts

CSS Overflow

CSS overflow property is used to control the behavior of content that exceeds the bounds of an element. It can be used to hide, scroll,

CSS Cursors

CSS cursors are used to change the appearance of the cursor when it is over a specific element on a web page. The CSS cursor

What are CSS Fonts

CSS fonts are used to control the appearance of text on a web page. The CSS font properties include: For example, the following CSS code

What are CSS Colors

CSS uses a variety of ways to specify colors for elements, including: It’s worth noting that in CSS, color names, Hex values and RGB values

Send Us A Message