Here we go again! Here’s a quick recap with a basic introduction to HTML, the most basic required elements of HTML, and the common elements of HTML. As discussed in the first couple posts about web development basics, websites are built on HTML, and HTML revolves around tags. Tags are not displayed on your browser; they’re used in the code to label pieces of content.
Now we’re ready to dive into the intermediate elements of a webpage. These elements start to make your page look like you’ve put some real effort into it. Some of the most common intermediate elements include:
Forms are used to collect information from a user. These can range from a simple newsletter signup that only requires an email address, to a very complex, multi-step survey. There are three basic elements that make a form work: a form tag, an input tag for data, and an input tag for submitting the form. You can also include label tags, but they are not mandatory.
Here’s an example of a simple newsletter signup form:
The form tag <form></form> surrounds all the inner label and input tags, and usually has two attributes: action and method.
The input tag is a self-closing tag (meaning it does not require a closing tag) that requires at least two attributes: name and type.
Ex: <input name="input_name" type="input_type">
The submit input is a special case that requires the attributes: type and value.
Ex: <input type="submit" value="Submit">
You can learn more about all the different input types here.
How you set up a working form usually depends on what server-side coding language you’re dealing with, so here is where we stop … for now.
The iframe tag is a very interesting type of HTML tag. These tags are most commonly used to embed other websites into your site. It may be very confusing until you see an example in action, but first, let’s look at a code example:
Code :
Even though the iframe element has opening and closing tags, you do not need to add any content inside the tags because everything is set with the attributes. The bare minimum attribute you need is the “src" attribute, which tells the iframe what url to pull content from. Check out two common examples below:
Here is an example of a YouTube embed:
Code :
Here is an example of a Google Map embed:
Code :
That’s about as much as we can get into regarding elements of a webpage without really sending your head spinning, so this is it, friends. Melz, signing off.