国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
Formatting Text with HTML tags
1. Formatting Text as bold in an HTML
2. Setting Text as Italic in HTML5
3. Highlighting Text with HTML Code
4. Underlining Text in HTML
5. Text with a strikethrough
6. Writing in Monospace font in HTML
7. Subscripted Text in HTML
8. Deleted Text in HTML5
9. Superscript Text formatting in HTML5
10. Making Text size larger with HTML formatting
11. Making Text smaller with HTML
Conclusion
Home Web Front-end HTML Tutorial HTML Text Formatting Tags

HTML Text Formatting Tags

Sep 04, 2024 pm 04:16 PM
html html5 HTML Tutorial HTML Properties HTML tags

Formatting text is an important part of modern internet web pages; even when we were limited to having text-based web browsers, text formatting such as size, orientation, etc., was available. With modern HTML revisions, there are a ton of HTML Tags that can be used to make the text appearance to your liking.

Formatting Text with HTML tags

Below we will discuss some important HTML tags that are used to format text:

1. Formatting Text as bold in an HTML

HTML has two different tags to set the text to a bold appearance. One is and the other one is while both produce similar output. The tag is a physical tag, only to display the text in bold, and it does not add any value of importance in the browser.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> <b>Here is some text in bold. </b></p>
</body>
</html>

Output :

HTML Text Formatting Tags

The tag, on the other hand, is considered as a logical tag, and it is used to inform the browser that the text in the tag has some logical importance.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> <strong>This is an important content formatted using the strong tag </strong>, and this is just
normally formatted text</p>
</body>
</html>

Output:

HTML Text Formatting Tags

2. Setting Text as Italic in HTML5

Just as setting text as Bold, you can use tag and tag to set text as italic on HTML5.

Using is for, just like using , physical display of text as italic and the tag while also showing the text as italic on display, lets the browser know that it has semantic importance.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> <i> This is the first para in italic text. </i></p>
<p> <em> This content is made italics with the em tag</em>, This is normal text </p>
</body>
</html>

Output:

HTML Text Formatting Tags

3. Highlighting Text with HTML Code

In situations where you want to highlight some text with a highlighter effect, the tag can be used; with default CSS, the tag makes the background of text as yellow, helping you grab a visitor’s attention on that text easily.

Example

Code:

<!DOCTYPE>
<html>
<body>
<h3> This text uses <mark> Mark</mark> tag to highlight text on the page </h3>
</body>
</html>

Output:

HTML Text Formatting Tags

4. Underlining Text in HTML

The HTML tag can be used to add an underline in the text. Be careful not to use underlining with blue text as it may confuse visitors that the text is a link.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> <u> This is Text with underline tag. </u> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

5. Text with a strikethrough

In cases where you need to draw a horizontal line through the text, tag can be used. The line drown is thin, so the text it is crossing can still be read easily.

?Example?

Code:

<!DOCTYPE>
<html>
<body>
<p> <strike> Here is a sentence with strike through text </strike>. </p>
</body>
</html>

Output:

HTML Text Formatting Tags

6. Writing in Monospace font in HTML

Using Monospace can be useful in situations where you want to quote something or you want to display some code in the browser. The Monospace code, as the name suggests, makes the width of every character the same. To get it on a browser, we have to use the tag.

?Example

Code:

<!DOCTYPE>lt;html>
<body>
<p> This is normal text. <tt>This is some sample text in monospace fonts, neat. </tt> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

7. Subscripted Text in HTML

In math and chemistry, using subscript is an absolute requirement on many occasions. In general writing, too, you may come across situations where a subscript text is suitable to use. In HTML, any text under the tag will work as a subscript in the browser.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> This is normal text <sub>Notice something different with this text? </sub> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

8. Deleted Text in HTML5

tag is used as a logical way of telling the browser that text inside the text is deleted. Keep in mind that to a user, the shown text is the same as the tag in strikethrough tag, meaning it is shown in strikethrough formatting.

?Example?

Code:

<!DOCTYPE>
<html>
<body>
<p> This is normal text <del> This is text between del tag. </del> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

9. Superscript Text formatting in HTML5

Text in tag is shown in superscript. This is useful in math, chemistry and other places where math is involved. You can use the tag when citing with adding in-page links with too.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> This is Normal text<sup> This text is in superscript. </sup> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

10. Making Text size larger with HTML formatting

In cases where you need some text in a larger size on the screen, but you don’t want to use a heading or increase the font size with a tag, use content between this tag will be displayed in noticeably larger text size.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> This is Normal text <big> This text in in larger size. </big> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

11. Making Text smaller with HTML

Like the tag , you can use to make text smaller on the screen without using CSS or headings.

Example

Code:

<!DOCTYPE>
<html>
<body>
<p> This is Normal text <small> the size of this text is smaller </small> </p>
</body>
</html>

Output:

HTML Text Formatting Tags

Conclusion

Now that you have learned how the formatting of text in HTML works, you should be able to design pages with correct and professional-looking text layout and formatting. It would help if you used normal text and formatting where possible; using custom formatting only when needed gives your pages a neat look. The normal text size is important too, too small, and the readably will be affected negatively, and if it is too large, there will be less information on the screen at once.

The above is the detailed content of HTML Text Formatting Tags. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the essential HTML elements for structuring a webpage? What are the essential HTML elements for structuring a webpage? Jul 03, 2025 am 02:34 AM

The web page structure needs to be supported by core HTML elements. 1. The overall structure of the page is composed of , , which is the root element, which stores meta information and displays the content; 2. The content organization relies on title (-), paragraph () and block tags (such as ,) to improve organizational structure and SEO; 3. Navigation is implemented through and implemented, commonly used organizations are linked and supplemented with aria-current attribute to enhance accessibility; 4. Form interaction involves , , and , to ensure the complete user input and submission functions. Proper use of these elements can improve page clarity, maintenance and search engine optimization.

Handling reconnections and errors with HTML5 Server-Sent Events. Handling reconnections and errors with HTML5 Server-Sent Events. Jul 03, 2025 am 02:28 AM

When using HTML5SSE, the methods to deal with reconnection and errors include: 1. Understand the default reconnection mechanism. EventSource retrys 3 seconds after the connection is interrupted by default. You can customize the interval through the retry field; 2. Listen to the error event to deal with connection failure or parsing errors, distinguish error types and execute corresponding logic, such as network problems relying on automatic reconnection, server errors manually delay reconnection, and authentication failure refresh token; 3. Actively control the reconnection logic, such as manually closing and rebuilding the connection, setting the maximum number of retry times, combining navigator.onLine to judge network status to optimize the retry strategy. These measures can improve application stability and user experience.

Declaring the correct HTML5 doctype for modern pages. Declaring the correct HTML5 doctype for modern pages. Jul 03, 2025 am 02:35 AM

Doctype is a statement that tells the browser which HTML standard to use to parse the page. Modern web pages only need to be written at the beginning of the HTML file. Its function is to ensure that the browser renders the page in standard mode rather than weird mode, and must be located on the first line, with no spaces or comments in front of it; there is only one correct way to write it, and it is not recommended to use old versions or other variants; other such as charset, viewport, etc. should be placed in part.

Implementing client-side form validation using HTML attributes. Implementing client-side form validation using HTML attributes. Jul 03, 2025 am 02:31 AM

Client-sideformvalidationcanbedonewithoutJavaScriptbyusingHTMLattributes.1)Userequiredtoenforcemandatoryfields.2)ValidateemailsandURLswithtypeattributeslikeemailorurl,orusepatternwithregexforcustomformats.3)Limitvaluesusingmin,max,minlength,andmaxlen

How to group options within a select dropdown using html? How to group options within a select dropdown using html? Jul 04, 2025 am 03:16 AM

Use tags in HTML to group options in the drop-down menu. The specific method is to wrap a group of elements and define the group name through the label attribute, such as: 1. Contains options such as apples, bananas, oranges, etc.; 2. Contains options such as carrots, broccoli, etc.; 3. Each is an independent group, and the options within the group are automatically indented. Notes include: ① No nesting is supported; ② The entire group can be disabled through the disabled attribute; ③ The style is restricted and needs to be beautified in combination with CSS or third-party libraries; plug-ins such as Select2 can be used to enhance functions.

Implementing Clickable Buttons Using the HTML button Element Implementing Clickable Buttons Using the HTML button Element Jul 07, 2025 am 02:31 AM

To use HTML button elements to achieve clickable buttons, you must first master its basic usage and common precautions. 1. Create buttons with tags and define behaviors through type attributes (such as button, submit, reset), which is submitted by default; 2. Add interactive functions through JavaScript, which can be written inline or bind event listeners through ID to improve maintenance; 3. Use CSS to customize styles, including background color, border, rounded corners and hover/active status effects to enhance user experience; 4. Pay attention to common problems: make sure that the disabled attribute is not enabled, JS events are correctly bound, layout occlusion, and use the help of developer tools to troubleshoot exceptions. Master this

Getting the user's current location with the HTML5 Geolocation API. Getting the user's current location with the HTML5 Geolocation API. Jul 02, 2025 pm 05:03 PM

When using HTML5Geolocation API to obtain user location, you must first obtain user authorization, and request and explain the purpose at the right time; the basic method is navigator.geolocation.getCurrentPosition(), which contains successful callbacks, wrong callbacks and configuration parameters; common reasons for failure include permission denied, browser not supported, network problems, etc., alternative solutions and clear prompts should be provided. The specific suggestions are as follows: 1. Request permissions when the user operation is triggered, such as clicking the button; 2. Use enableHighAccuracy, timeout, maximumAge and other parameters to optimize the positioning effect; 3. Error handling should distinguish between different errors

Improving SEO with HTML5 semantic markup and Microdata. Improving SEO with HTML5 semantic markup and Microdata. Jul 03, 2025 am 01:16 AM

Using HTML5 semantic tags and Microdata can improve SEO because it helps search engines better understand page structure and content meaning. 1. Use HTML5 semantic tags such as,,,, and to clarify the function of page blocks, which helps search engines establish a more accurate page model; 2. Add Microdata structured data to mark specific content, such as article author, release date, product price, etc., so that search engines can identify information types and use them for display of rich media summary; 3. Pay attention to the correct use of tags to avoid confusion, avoid duplicate tags, test the effectiveness of structured data, regularly update to adapt to changes in schema.org, and combine with other SEO means to optimize for long-term.

See all articles