What is HTML?
Basic HTML page
<!-- index.html --> <!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <p>Content</p> </body> </html>
Most of HTML tags have to be closed like
<title></title>, but some of them are self-closing tags like
<img src="myimage.jpg" />.
<head> is the place where all properties are read by the browser and use to render your web page. Here you can place CSS files, title, and meta tags. Inside
<body> is the actual content rendered in the browser.
Most common elements used in html are the following:
<h1>Some title</h1>Header titles can be from h1 to h6 ( big font to small )
<img src="myimage.jpg" />src is the source of image ( absolute / relative path )
<input type="text" name="mytext" />type can be different depending on usage ( submit, password, email, hidden etc ) and name is the key to read the value
<form> <!-- fill with inputs --> </form>to send the data to server all inputs have to be inside a form that has action and method filled ( we’ll practice this later )
<a href="nextpage.html" />href is the target page
<div> <!-- fill with anything --> </div>more of a generic tag, a div is kind of a container to separate purposes of tags and style easier the page
- Line break:
To create more easily readable code you can add some tags specific to certain areas of the page.
- Navigation bar:
Try to create an .html file in your favourite editor ( you can choose one here ) and exercise a few tags inside the body. See you in the next article!