HTML attributes provide additional information about HTML elements.
link: <a href="<https://www.w3schools.com>">This is a link</a>
The link's destination is specified in the href
attribute.
Attributes are used to provide additional information about HTML elements.
<img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142">
HTML images are defined with the <img>
tag.
The source file (src
), alternative text (alt
),
width
, and height
are provided as attributes:
<p style="color:red;">This is a red paragraph.</p>
<pre>
to preserve all the spaces and newlines.
<tagname style="property:value;">
The CSS text-align property defines the horizontal text alignment for an HTML element:
<p style="text-align:center;">Centered paragraph.</p>