Html Attributes
Html Attributes: Html element’s attribute are used to provide some more information about the element.
This way you can use Attributes Syntax
<start_tag attribute_name="Attribute Value"></end_tad>
Note 1 : Attributes are always defined in the start tag of the element.
Note 2 : Single Quote or double Quote any one can be used.
Example :
<start_tag attribute_name='Attribute Value'></end_tad>
Lets Understand with very simple examples:
Html Attributes Example : Title
Example
<!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <p title="My first Paragraph">Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....Demo text....</p> </body> </html> |
Output :
Attributes Example : href
Example
<!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <a href="https://www.google.com"> Google.com</a> </body> </html> |
Output :
Advertisements
Add Comment
📖 Read More
- 1. Html Headings
- 2. Html Paragraphs
- 3. Html Styles
- 4. Html Formatting
- 5. Html bold tag
- 6. Html strong tag
- 7. Html Italic Tag
- 8. Html mark tag
- 9. Html small tag
- 10. Html delete tag