Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which symbol is used on both sides of the html5 attribute value

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The editor will share with you which symbol is used on both sides of the html5 attribute value. I hope you will get something after reading this article. Let's discuss it together.

In html5, attribute values are enclosed in English state double quotes "" and "" or single quotation marks "" and "'". Syntax "attribute name =" attribute value "or" attribute = 'attribute value' "; although both double quotation marks and single quotation marks can surround attribute values, double quotes are used as far as possible for the sake of standardization and professionalism.

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

What are attributes?

Attributes can provide some additional information for the HTML tag, or decorate the HTML tag. The attribute needs to be added to the opening tag, and the syntax format is:

Attr= "value" attr='value'

Attr represents the property name, and value represents the attribute value. Property values must be surrounded by double quotes "" or single quotation marks''.

Note that although both double quotes and single quotes can surround attribute values, use double quotes as much as possible for the sake of standardization and professionalism.

A tag can have no attributes, or it can have one or more attributes.

An example of using the HTML property:

Welcome to Tom!

The account information of Tom is displayed here

Tom's personal signature is shown here.

Special attribute

There are many HTML attributes, which can be broadly divided into two categories:

Some attributes apply to most or all of the HTML tags, and we call them generic attributes

Some attributes apply only to one or more specific HTML tags, and we call these attributes proprietary attributes.

In HTML

Tags have two special attributes, src and alt, and tags also have two special attributes, href and target, as shown in the following example:

Logo

Description of the code:

The src attribute in the tag is used to define the path of the image, and the alt attribute is used to define the description information of the image. When the image is abnormal and cannot be displayed properly, it will display the information in the alt.

The href attribute of the tag is used to define the address of the link, and the target attribute is used to define how the new page is opened in the browser.

Custom attribute

In addition to its own attributes, HTML also allows us to customize attributes, which can be recognized by browsers, but do not add any special effects. We need to use CSS and JavaScript to deal with custom attributes and add specified styles or behaviors to HTML tags.

After reading this article, I believe you have a certain understanding of "which symbol is used on both sides of the html5 attribute value". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report