HTML – Let’s Create A Project & Understand It
In first article we understood some basics of html. Now in this article we will create one project and will work on it.
Let’s Create Project
As I have already said as a part of exercise we will be creating and working on a same project throughout this series of articles. Now open a new file in notepad name is whatever you like and save it as an html file. After doing this open this file with notepad and type following code in it:
Now open this file with browser and you will see the following output:
Now Let’s Understand This Code:
This code file is a little bit complex for new html learner but simple who know how to create a static webpage. Here we have used some new tag comparing to previous example. So let’s understand each and every tag step by step:
<img> Tag of HTML
img tage is fairly a simple tag to include images in any website and webpage. Here src is an attribute where no need to provide the path of your image file. My image is in the same folder so I have just provided the name. Then after if your browser does not support your image tag or any error occurs in such situations alternative text will be displayed. In this case text is defined in alt attribute is MyPhoto. Finally with the help of height and width attribute you can set the height and width of an image.
<strong> And <br/> tags
<strong> tag is used to print a text bold as explained earlier. I think you might have found something interesting in this line. Have you marked that <br/> tag is different and even doesn’t have any end </br> tag? I guess you have. Let see this now. Firstly <br/> tag is used to do a line break. The full form of br is break. It is a self-ending tag and does not require any specific end tag. So <br/> itself is ending tag.
So I hope you have enjoyed this article. This article was just a small representation of whole html. HTML5 is latest version of html. I recommend you to visit w3school by clicking here and go in depth of html which will really help you a lot. In next article we will understand the css and add it in our project. The next articles will be published soon.