Introduction to HTML || Links and Inputs || Part 4

Web Dev Simplified · Beginner ·💻 AI-Assisted Coding ·7y ago

Key Takeaways

This video covers the basics of HTML, specifically anchor tags and input tags, to create links and interactive forms, and uses tools like HTML, Visual Studio Code, and Live Server to demonstrate the concepts.

Full Transcript

hello everybody welcome to the final video on the basics of HTML in this video we'll dive into one more crucial HTML element as we build the store page of the band website by the end of this video we'll have created all the HTML that we need for the entire project before we get started coding we need to cover one of the most important and most common HTML elements the anchor tag the anchor tag also known as the a tag is the HTML element that allows us to add links to our web pages the structure of the anchor tag is very similar to that of an image tag but instead of specifying a source attribute for an image an anchor tag uses an href attribute which stands for hypertext reference the href attribute works exactly like the source attribute when trying to find the file you specified this means that the href attribute value should be relative to the HTML file that the anchor tag is in for example if you had a file called page HTML in the same folder as the HTML file with the anchor tag then you would use page HTML as the href of the anchor tag to link to page HTML another use of the href tag is to link to other web pages by their URL this also works exactly the same as the source attribute of the image tag if you want to create a link to Google then you would create an anchor tag and set the href to Google's URL the shoe all must be the full URL of the website which includes HTTP at the beginning in order for an anchor tag to work the href attribute must be defined another common attribute the target attribute on the other hand is optional the target attribute specifies where the link should open by default the value of the target attribute is self which means the link should open in the current browser tab the only other value for the target attribute is blank that means that the link opens in a separate tab don't forget to make sure you include the underscore in the front of the self and blank target attribute values or they will not work we will cover both target types in the coding section of this video so if this does not make sense yet it will become obvious in a bit now that we got that out of the way let's jump into the coding of the store page for the band website hello everybody welcome to the coded section of this video as you can see on the Left I have visual studio code opened with the project from the last video that we left off on the only difference is that inside the images folder I've added all the images that we're going to need to create the store page of the band website on the right of my screen I have a picture of the store web page pulled up so we can use this as a reference to create the HTML for the band page let's get started by copying the about HTML page and renaming it to store tout HTML this is because our store page and our about page both share the same header and the same footer now let's delete the content in the center about the about page that we do not actually need in the store page what we do need is we need to create a section for the music section for merch intersection for cart let's do that inside of each of these sections we're also going to have the header for the title of music merchant cart now let's take a look at the content inside of each of these sections as you can see the music emerge section both share the same template for its content where it has an album or t-shirt or coffee cup whatever is being sold picture of that the price of it and then a button to add it to the cart so let's create these elements we're going to want to do we're going to want to wrap this entire element inside of a div element so that way we know it is one contained content inside of that div we're going to want to have a div for the album name this is because we want this to be on its own line so we can't just use a span and inside of that div since this is bolded we will use a strong tag to put the title of album 1 next we're going to want to add the image tag and it's going to have a source attribute which in our case is going to be images slash album 1 dot PNG and lastly we need to add a final div that's going to wrap both the price and button for adding to cart we're going to put the price inside of a span and then we're going to add the button for Add to Cart and make sure to add the role of button since this is just a general generic button now let's open that up using live server to see what our changes look like as you can see we have the album name picture of the album and then the line containing the price and the button to add to cart' the only thing left to do now is to copy this and paste it down four times so that we have the section like this for all the album's that we are selling in the music section of our store I'm going to do that now now if we open that up we can see that we have our four different albums being displayed with the title the top picture in the middle and price button at the bottom you may notice however though that they are all on the individual line as opposed to being side by side as they're on this image this is because we are wrapping all of them inside of a div and divs break the line as we talked about earlier later we are going to fix this in the CSS portion of our course but for now we will just keep it like this because as you remember HTML was only for content and CSS is where we talked about way out and display now if we go back to the image of our store page we can see that in the merge section we have almost the exact same layout that we do inside of the music section of our store so I'm just going to copy one of the templates from the music section paste it into the merge section and change it accordingly now if we go view this you'll see that these also show up at the bottom inside the merge section the last thing that we have to look at is the card section of our store this is slightly different than the rest of our sections and includes a few new elements that we haven't talked about yet let's first get started by creating the header row of item price and quantity to do this we will wrap all three of these in a div so that they appear on the same line and we will use strong tags to wrap all the content because it is bolded now if we go take a look at that we'll see that we have item price and quantity all displayed on the same line but we will use the same spacing trick that we used in the last video in order to show the space between these because right now it is difficult to read so in our code we are going to add a less-than and greater-than sign let's go add a little bit of spacing between our elements we'll just copy it one more time so it's between price and quantity as well next we are going to work on adding in each of the individual rows of this section we'll do this by using another div tag to wrap the entire row followed by an image tag to store the image for the first 5 min we'll use the source to the album 1 as we talked about earlier and close that and we will go look at it and we'll see that this image is way too large we want this image to be much smaller in order to do that we can set a width and height property on the actual image element itself this attribute we're going to set to 100 which will stand for 100 pixels if we leave off the height element it will automatically adjust the height to be an aspect ratio with the width so if we had a image that was 200 pixels by 400 pixels so 200 pixels wide at 400 pixels tall and we set the width to 100 the new height would be 200 which would automatically be set if we however set both the height and the width it will automatically check both those for us to be 100 and 100 next we're going to want to add the name of the actual item inside of a span we will just call this t-shirt and then we want to add Christ instead of a span as well in between those we're going to want to use the less-than and greater-than signs that we talked about for our spacing if we view that we'll see that we have the name of the item followed by the price of the item next we need to add in this input that allows users to select the quantity of item that they want where they can type in any number that they want in here in order to do this we're going to use an input element an input element is an empty element that allows us to create an input of various different types in this case we are using a number input so we will set the type equal to number there are many different types of input that you can create but the most common types are a number input and a text input we then close that off and if we go back to our page you will see that we have an input in here that allows us to enter only numbers into it we cannot enter anything that is not a number just numbers but in our example you can see that we have this pre-populated with a 1 in order to do this we'll set the value of property the value property corresponds to the value of the actual input element and as we change it as we type in different numbers into the input this value will automatically adjust to be the same as whatever number we typed in here so over here let's just put the value of 1 because that is what is in our picture here I'm also going to use the same spacing tricks that we talked about the less than greater sign to add a space between this price and the input and lastly we need to add in a button this button will have the role of button because it is a generic button an inch that of it will just put the text remove now if we go back to our page we can see that we have all the elements here that we have in our image over here now it's copy this div one time and fill it in with the information from the second row down here now if we go back we can see that we have the correct information here I also changed this first image to be the shirt image because I forgot to change that and as we can see we have the value of 2 in here which corresponds to the value of the input element here lastly let's add an HR after all these in order to put that line at the bottom of the page that we have here before we get to total the reason I'm not including an HR under these item price and quantity views is because we will add these later with CSS this is because an HR takes up the entire space that is given which in our case will be all the way from the far left web page to the far right of our page with no breaks in between now let's add a final div which is going to contain the information for the total and the price as we can see the total is emphasised with bold so we use a strong tag and type in total and then we will have the price inside of a span lastly we want to add this purchase button at the very bottom underneath of everything else so which side of a tip of its own so that it is on its own line we're adding a button with the role of Clutton and we will give you the text of purchase and that's all there is to creating this HTML here and as we can see if we look over here we have all the elements that we have on this page created in HTML here the last thing we have left to do is add in blinks so that we can navigate with the home store and about buttons that we have up here in order to do that let's scroll up to the very top and wrap this text inside of an a tag as we talked about earlier so that now our text is a link but in order for this link to work we needed the href that we talked about earlier since our store page is in the same page as our index page which is our home page all we need to type in is index.html and now when we save this we'll have a link here that when we click on it will bring us to the index.html page now let's go back to the store page and do this for all of our different links now you can see that we have buttons for the home page store page in the about page and when clicked on they'll bring us to the different pages at the very bottom we'll notice that we also have buttons for YouTube Spotify and Facebook so now we need to add anchor tags wrapped around this but as you can see there's no text for us to wrap around all there is is this image tag but that is okay we can wrap this image tag inside of an anchor tag and it will work as a button in order to do this create the anchor tag give it a rich href which in this case is going to be the URL of YouTube which is HTTP colon backslash backslash youtube.com and then we will put the image tag inside of this a tag and we say that if you hover over YouTube we can see that there's a button and if we click it it'll bring us to youtube.com what's do the same thing for Spotify and Facebook now if we save that we can see that the youtube link spotify link and facebook link are all working as you can see if we click here we go to the spotify website and so on but one problem is that when we click these links it'll override the tab that we're in and we don't want that for these bottom links so we're going to use the target attribute on our href and we're going to set it to underscore blank I'm going to copy this over to all the rest of our links and now when we click on a link for Spotify for example it'll open in a new tab while keeping the tab for our original page now all we need to do is copy these new links that we created over to our home and our about page and our HTML will be completely finished for the entire website and there we go now if we go to any of these pages you'll see that we have links that work on all of our pages one last thing that I forgot to mention is that in our store page we want to change the title of our page from the generics about to the generics store and there we go that is all the HTML that we need for this entire project in our next set of videos we'll be covering CSS CSS is what is going to allow us to take in this boring wyeandluke in HTML and converting it over to this beautiful looking mock-up that we have over here after we're done with the CSS for all of our pages we're then going to jump into JavaScript which will allow us to make our Store page interactive this will make us that the add Cart button actually adds elements to the cart down here the remove element actually removes them and changing the numbers inside of the quantity will actually update the total and that is all there is to HTML while we have covered many HTML elements there are still many more HTML elements that we have not covered I have only selected the most important and useful HTML elements to cover in this traductor course because many of the HTML elements are either obsolete or only useful in very specific scenarios even I do not know all the HTML elements and you should not know them all either if there is however any HTML elements or concepts that you feel I have missed please let me know down in the comments below and I'll be sure to cover them in future videos also please don't forget to Like and subscribe if you're enjoying the content thanks for watching

Original Description

In this final video on the basics of HTML we learn how to use anchor tags and input tags to create links, and interactive forms. We will also use all of the skills we learned from the previous videos to create the HTML for the store page of the band website. By the end of this video you will have finished all of the HTML for the band website, and will have a strong grasp on the basics of HTML. This Lessons Files: https://github.com/WebDevSimplified/Introduction-to-Web-Development/tree/master/Introduction%20to%20HTML/Lesson%204 Twitter: https://twitter.com/DevSimplified GitHub: https://github.com/WebDevSimplified
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Web Dev Simplified · Web Dev Simplified · 6 of 60

1 Introduction to Web Development || Setup || Part 1
Introduction to Web Development || Setup || Part 1
Web Dev Simplified
2 Introduction to Web Development || Understanding the Web || Part 2
Introduction to Web Development || Understanding the Web || Part 2
Web Dev Simplified
3 Introduction to HTML || Your First Web Page || Part 1
Introduction to HTML || Your First Web Page || Part 1
Web Dev Simplified
4 Introduction to HTML || Basic HTML Elements || Part 2
Introduction to HTML || Basic HTML Elements || Part 2
Web Dev Simplified
5 Introduction to HTML || Advanced HTML Elements || Part 3
Introduction to HTML || Advanced HTML Elements || Part 3
Web Dev Simplified
Introduction to HTML || Links and Inputs || Part 4
Introduction to HTML || Links and Inputs || Part 4
Web Dev Simplified
7 Learn Git in 20 Minutes
Learn Git in 20 Minutes
Web Dev Simplified
8 5 Must Know Sites For Web Developers
5 Must Know Sites For Web Developers
Web Dev Simplified
9 10 Best Visual Studio Code Extensions
10 Best Visual Studio Code Extensions
Web Dev Simplified
10 Learn CSS in 20 Minutes
Learn CSS in 20 Minutes
Web Dev Simplified
11 How to Style a Modern Website (Part One)
How to Style a Modern Website (Part One)
Web Dev Simplified
12 How to Style a Modern Website (Part Two)
How to Style a Modern Website (Part Two)
Web Dev Simplified
13 3D Flip Button Tutorial
3D Flip Button Tutorial
Web Dev Simplified
14 How to Style a Modern Website (Part Three)
How to Style a Modern Website (Part Three)
Web Dev Simplified
15 Animated Loading Spinner Tutorial
Animated Loading Spinner Tutorial
Web Dev Simplified
16 How to Write the Perfect Developer Resume
How to Write the Perfect Developer Resume
Web Dev Simplified
17 Animated Text Reveal Tutorial
Animated Text Reveal Tutorial
Web Dev Simplified
18 Learn Flexbox in 15 Minutes
Learn Flexbox in 15 Minutes
Web Dev Simplified
19 Custom Checkbox Tutorial
Custom Checkbox Tutorial
Web Dev Simplified
20 Start Contributing to Open Source (Hacktoberfest)
Start Contributing to Open Source (Hacktoberfest)
Web Dev Simplified
21 JavaScript Shopping Cart Tutorial for Beginners
JavaScript Shopping Cart Tutorial for Beginners
Web Dev Simplified
22 Responsive Video Background Tutorial
Responsive Video Background Tutorial
Web Dev Simplified
23 1,000 Subscriber Giveaway
1,000 Subscriber Giveaway
Web Dev Simplified
24 How To Prevent The Most Common Cross Site Scripting Attack
How To Prevent The Most Common Cross Site Scripting Attack
Web Dev Simplified
25 Transparent Login Form Tutorial
Transparent Login Form Tutorial
Web Dev Simplified
26 The Forgotten CSS Position
The Forgotten CSS Position
Web Dev Simplified
27 How to Code a Card Matching Game
How to Code a Card Matching Game
Web Dev Simplified
28 10 Must Install Visual Studio Code Extensions
10 Must Install Visual Studio Code Extensions
Web Dev Simplified
29 Learn CSS Grid in 20 Minutes
Learn CSS Grid in 20 Minutes
Web Dev Simplified
30 Learn JSON in 10 Minutes
Learn JSON in 10 Minutes
Web Dev Simplified
31 10 Essential Keyboard Shortcuts For Programmers
10 Essential Keyboard Shortcuts For Programmers
Web Dev Simplified
32 What Is The Fastest Way To Load JavaScript
What Is The Fastest Way To Load JavaScript
Web Dev Simplified
33 Differences Between Var, Let, and Const
Differences Between Var, Let, and Const
Web Dev Simplified
34 How To Install MySQL (Server and Workbench)
How To Install MySQL (Server and Workbench)
Web Dev Simplified
35 Learn SQL In 60 Minutes
Learn SQL In 60 Minutes
Web Dev Simplified
36 How To Solve SQL Problems
How To Solve SQL Problems
Web Dev Simplified
37 What Are Design Patterns?
What Are Design Patterns?
Web Dev Simplified
38 Null Object Pattern - Design Patterns
Null Object Pattern - Design Patterns
Web Dev Simplified
39 Your First Node.js Web Server
Your First Node.js Web Server
Web Dev Simplified
40 How To Setup Payments With Node.js And Stripe
How To Setup Payments With Node.js And Stripe
Web Dev Simplified
41 How To Learn Any New Programming Skill Fast
How To Learn Any New Programming Skill Fast
Web Dev Simplified
42 Asynchronous Vs Synchronous Programming
Asynchronous Vs Synchronous Programming
Web Dev Simplified
43 JavaScript ES6 Arrow Functions Tutorial
JavaScript ES6 Arrow Functions Tutorial
Web Dev Simplified
44 Are You Too Old To Learn Programming?
Are You Too Old To Learn Programming?
Web Dev Simplified
45 JavaScript Cookies vs Local Storage vs Session Storage
JavaScript Cookies vs Local Storage vs Session Storage
Web Dev Simplified
46 JavaScript Promises In 10 Minutes
JavaScript Promises In 10 Minutes
Web Dev Simplified
47 Builder Pattern - Design Patterns
Builder Pattern - Design Patterns
Web Dev Simplified
48 JavaScript == VS ===
JavaScript == VS ===
Web Dev Simplified
49 JavaScript ES6 Modules
JavaScript ES6 Modules
Web Dev Simplified
50 8 Must Know JavaScript Array Methods
8 Must Know JavaScript Array Methods
Web Dev Simplified
51 CSS Variables Tutorial
CSS Variables Tutorial
Web Dev Simplified
52 JavaScript Async Await
JavaScript Async Await
Web Dev Simplified
53 How To Choose Your First Programming Language
How To Choose Your First Programming Language
Web Dev Simplified
54 Easiest Way To Work With Web Fonts
Easiest Way To Work With Web Fonts
Web Dev Simplified
55 Singleton Pattern - Design Patterns
Singleton Pattern - Design Patterns
Web Dev Simplified
56 Responsive Navbar Tutorial
Responsive Navbar Tutorial
Web Dev Simplified
57 CSS Progress Bar Tutorial
CSS Progress Bar Tutorial
Web Dev Simplified
58 Learn GraphQL In 40 Minutes
Learn GraphQL In 40 Minutes
Web Dev Simplified
59 What is an API?
What is an API?
Web Dev Simplified
60 Learn How To Build A Website In 1 Hour!
Learn How To Build A Website In 1 Hour!
Web Dev Simplified

This video teaches the basics of HTML, including how to create links and interactive forms using anchor tags and input tags, and demonstrates how to use these concepts to create a store page for a band website. By the end of this video, viewers will have a solid understanding of HTML basics and be able to apply them to real-world projects.

Key Takeaways
  1. Copy the about HTML page and rename it to store HTML
  2. Delete the content in the center of the about page that is not needed for the store page
  3. Create a section for music, merch, and cart
  4. Wrap the entire element inside of a div element
  5. Create a div for the album name and use a strong tag for the title of the album
  6. Open the HTML file in Live Server to view changes in real-time
  7. Copy and paste the HTML code for the album cards to create multiple cards
💡 The key insight from this video is that HTML is a fundamental skill for web development, and understanding how to create links and interactive forms is crucial for building dynamic and user-friendly websites.

Related AI Lessons

How to Maximize Codex Exec Command
Maximize Codex Exec Command by building a model ensemble for a more powerful coding agent setup
Towards Data Science
AI Can Write Code. So Why Are People Still Learning It?
Learn why coding is still a valuable skill despite AI's ability to write code, and how it can enhance career prospects and problem-solving abilities
Medium · Python
Rethinking Developer Productivity In The Age Of AI-Native Engineering
Learn how AI-native engineering is redefining developer productivity and what new metrics leaders should track to measure real impact
Forbes Innovation
Lovable.dev Pricing Plans 2026: The Real Cost of Building AI Apps
Learn about Lovable.dev's 2026 pricing plans and the real cost of building AI apps to make informed decisions for your project
Medium · AI
Up next
Azure Security Priorities for 2026: Identity, Governance, AI Security & Zero Trust
Valto Microsoft Specialists
Watch →