HTML Attributes — HTML
HTML attributes give additional information about HTML elements. Using a variety of attributes we can add new dimensions and functionality to elements.
The href attribute can be used with the hyperlink element <a> tag to identify exactly where we want that link to go, whether it is an internal link within the site itself or an external link to the World Wide Web at large.
<a href=”projeda.com\tech\table-of-contents”>This is a link to the SciTech Contents.</a>
Or we could identify a specific CSS class to give style to our HTML element. In this page, that is how I gave specific words unique font qualities — like red, orange, blue, bold, or the font-size. Each of those are specific HTML attributes of the paragraph element. To create red text you would specify the HTML attribute once you have established a name for it in your CSS as follows
<span class=”red-text”>This text will be red in the browser.</span>
In the above example class is the attribute and =”red-text” is the value of the attribute, while <span> is the element. All HTML elements can have attributes. HTML attributes are always specified with a start tag, and usually come in pairs of the format name=”value”. The attribute is identified in the name section while the value is given in the =”value” section.
Remember to place the = sign after the HTML attribute name, and give the specific value of that HTML attribute in quotations. Either (” “) double quotations or (‘ ‘) single quotations are fine for stating the value of the attribute.
Cite This Article
MLA
West, Brandon. "HTML Attributes — HTML". Projeda, April 22, 2024, https://www.projeda.com/html-attributes-html-course/. Accessed May 2, 2025.