The first tag we going to talk about is heading tag. Basically heading tag is use tell browser "this is a heading so display it in a large size".There are 6 different font size you can choose for your heading by using
<h1>
to <h6>
tag with <h1>
being the largest and <h6>
is the smallest. As always, each tag needs an open and closing tag so make sure you pair each of your <h1> <h2> ....
tag with </h1> </h2> ....
tag. To show how it works, open the HTML file we created in the previous in your text editor and edit it as follow,
Notice how I only use <h1> and <h2> here. Normally, we only use <h1> up to <h3> in a website because your website will looks really weird if you have like 6 different size of heading there. Also, if you notice, I also make an indent before each tag I put between the <body> tag. It is not required to make the indent but it is a good practice to do them as it will make your HTML file cleaner and easier to read. This way, your will know which tag is inside which with just a glance. Once you're done editing, save your file and refresh your browser. you should see something like this in your browser.
Anchor tag is used to make a link to a certain place but unlike other tag, anchor tag has an attribute and value which specify where the link is connected to. For example,
The <a> is the anchor tag and it is followed by a closing tag. Anything in between the opening and closing off anchor tag is what you want to make into a link, it can be a text or even image. In this case, we make the word 'tutorial' into a link. Notice there is an extra text in the <a> tag. the href is an attribute which is the hyperlink reference. It means that any value given to this attribute is the target of the link. The url in the quotation mark is the value of the attribute which means it is the target of the link. Note that quotation mark is always needed to give value to an attribute.
Now lets save the file and refresh your browser, you should get something like this,
The word 'tutorial' had become a link and if you click it, it should sent you to the url we put in the anchor tag earlier. The underline and colour for the word 'tutorial' is the default style for links, we will learn how to change them later in CSS tutorial.
If you got any question about what we've learnt so far, feel free to ask in the comment below. see you in the next tutorial.
No comments:
Post a Comment