Get the App
SLTechnology News&Howtos  ›  Development  › 

Can the attribute value of HTML5 not need quotation marks?

Shulou Source: shulou.com Published: 2022-06-01 10:28:42 11月10日 Update

This article mainly introduces the attribute value of HTML5 can be without quotation marks, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

The value of the HTML5 attribute can be without quotation marks.

We recommend using quotation marks for attribute values:

Use quotation marks if the attribute value contains spaces.

Mixed style is not recommended, it is recommended to unify the style.

Property values are easy to read using quotation marks.

The following instance property values contain spaces and do not use quotation marks, so they do not work:

The following double quotation marks are correct:

Picture Properti

Pictures usually use the alt attribute. When the picture cannot be displayed, it can replace the picture display.

Define the size of the picture, you can reserve the specified space when loading to reduce flicker.

Spaces and equal signs

Spaces can be used before and after the equal sign.

But we recommend using fewer spaces:

Avoid too long a line of code

With the HTML editor, it is not convenient to scroll the code around.

Try to have less than 80 characters per line of code.

Thank you for reading this article carefully. I hope the article "can the attribute value of HTML5 without quotation marks" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Attributes quotation marks pictures spaces articles no code recommendation equal sign style line value function interest at the same time characters examples dimensions suggestions more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi Microsoft Apple Shulou Tech Info