HTML Introduction to HTML and CSS Adding a New Web Page Set up an HTML Document

whats the difference between class href in the html

whats the difference between class href in the html

1 Answer

Matt Brock
Matt Brock
28,300 Points

The class attribute allows you to set a value that you can "hang" CSS styles onto, while the href attribute is used on anchor tags (a) and others to link to a webpage, file, email address, and more. Here are a couple articles that will help:

Anchor element attributes: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes

The class attribute: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class