What is an HTML Attribute?
Simply put, an HTML attribute add extra info to the HTML elements.
Syntax
<element attribute-name=“value”> content </element>
Example
<!DOCTYPE html> <html> <head> <head> <body> <h1> call me heading, I am also a element, I am also a Style attribute even if you can’t see me </h1> <p style=“height: 55px; color: green”> call me paragraph, with style property of height and color green <p/> <body> </html> |
notes:
attribute name in color orange and attribute value in color blue and everything inside the html tags are consider elements