Open up your text editor and type this into a new file:
<h1>Hello!</h1>
Save your file and open it in your browser.
Ta da! You're a website developer!
The code you wrote consisted of one HTML element. An element consists of:
<h1>
Hello!
</h1>
The element is identified by its opening tag. We would say that we wrote an "h1 element".
Elements can also contain attributes. Some elements require the presence of certain attributes in order to function. For example, let's add a link to Google:
<a href="https://www.google.com">Search</a>
Save the file and refresh your browser. You should now have a link that you can click to go to Google's home page.
The href
attribute above is how the browser knew what to do
when the content Search was clicked.
Attributes have a name and a value, always separated by an =
sign, and the value is always enclosed in quotation marks.
In the above example,
href
https://www.google.com