Attributes | Works | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
href |
The link address is specified in the "href" attribute. < a href="https://www.w3schools.com"> This is a link < /a> |
||||||||||||
src |
The filename of the image source is specified in the src attribute. < img src="img_girl.jpg" > |
||||||||||||
width and height |
HTML images have width and height attributes,
which specifies the width and height of the image < img src="img_girl.jpg" width="500" height="600" > Here, width="500" means 500 pixels wide. |
||||||||||||
alt |
The alt attribute specifies an alternative text to be used, if an image cannot be displayed (e.g. if it does not exist). The value of the alt attribute can be read by screen readers. This way, someone "listening" to the webpage, e.g. a vision impaired person, can "hear" the element. < img src="img_girl.jpg" alt="Girl with a jacket" > |
||||||||||||
style |
The style attribute is used to specify the styling of an element, like color, font, size etc. Ex:
You can also use more than 2 style attributes like this: |
||||||||||||
lang |
The language is declared with the lang attribute. The language of the document can also be declared in the < html> tag. Declaring a language is important for accessibility applications (screen readers) and search engines. < html lang="en-US">< /html> The first two letters specify the language (en). If there is a dialect, add two more letters (US). |
||||||||||||
title |
The value of the title attribute will be displayed as a tooltip when you mouse over the paragraph. < p title="I'm a tooltip"> This is a paragraph. < /p> |
||||||||||||
disabled | Specifies that an input element should be disabled | ||||||||||||
id | Specifies a unique id for an element. For Details | ||||||||||||
class | For Details |