, ,
the filename of the image source is determined by the src.
attribute src.
For example
Images in HTML also have properties that determine the size, width and height.
For example
The image size is determined in pixels, with a height of 200 pixels and a width of 540 pixels. There will be separate images in the following HTML for you to understand.
The alt
attribute specifies the alternate text used when the image cannot be displayed. The value of this attribute can be read on the screen reader. As a result, people can 'listen' to the website, for example, visually impaired people can 'listen' to HTML elements.
For example
The alt
attribute is also useful if the image does not exist. Eg:
style
attribute is used to define the style for an element, such as color, font, size .
For example
I like reading Network Administration
Text language is defined from the card Language is defined by lang attribute. Language definition is very important for applications that support accessibility (such as screen readers) and search engines.
…
The first two letters define the language, and if you want to specify only the dialect, use the following 2 letters (US). This indicates the text used in American English.
The title
attribute is added to the element
with the value of the attribute displayed as a comment when you drag the mouse over the text.
For example
Tôi đang học HTML trên Quản trị mạng.
Use quotation marks for values
Although HTML5 is not required to have quotation marks for attribute values, W3C encourages you to use this mark. Sometimes using quotation marks is mandatory, as in the example below, the title will not display properly without a quotation mark, because it contains spaces.
Should I use double quotes or single quotes?
It is possible to use single quotation marks but double quotation marks are still more common in HTML. In some cases, when right in the attribute value already contains double quotation marks, it is advisable to use a single quotation mark, and vice versa.
hoặc
Previous article: Elements in HTML
The following article: Title tags in HTML