SQL For Beginner

Saturday, June 30, 2018

Line breaks , comments & spaces

HELLO FRIENDS !!! welcome to your 3rd tutorial on HTML.

In this tutorial we are going to look at how to add line breaks, private comments and spaces to your HTML code.

Now if you read the last tutorial, we are going to go ahead and use that HTML file we created in last post.

Web page we created in last tutorial.

Now what we want to do is we need to add some lines between header section and paragraph section.
What we are going to do now is reopen that file in notepad.
(Right click on that file, select open with & select notepad) that will allow us to look at the code we did.

example of webpge
(Example)























As you know, we used <h>  section two times & <p>  section two times,

So what you want to do is go ahead and hit ENTER button three times in between the two sections, that should give us the space between our sections. Then save as the file in HTML format (test.html) and reopen the file by double clicking on the file & you will  notice that nothing is happens there.
why??

Actually you have to identify line breaks with HTML code otherwise it's as if nothing happened, it will just ignore these and keep going to next section. So we actually do have to put line break there, for this you have to put the BR tag .














& if you remember i said about empty elements in my introductory post and an empty element does not need a closing tag.
The reason is because we are not putting anything in between these tags. Late's go ahead and save this again in HTML format.
Reopen this file & you will see we have got our line breaks.

Now lets do a comment section, it is used to keep notes in your HTML code, that is you want notes for your code but you do not want it to be displayed on your web page. In order to do that we use this opening tag  (  <!--  ). Then you can put whatever you want there, it will only display to you in your 
coding file, it is like private notes on your code. Now close it with this closing tag  (  -->  ).
Remember exclamation mark ( ! ) is the most important in this tag otherwise it will display on your web page like a text.



Go ahead, save this file & reopen the file you will notice nothing is displayed on the web page.




















Now i will show you how to add spaces or additional spaces between text. In HTML it automatically creates only single space  in between two words. 
In order to accomplish that we have to put in (  &nbsp  ). You can put this no of times as many spaces you want, so if you put this four times it will create a four spaces. 


Late's save again and if you open the file,  there you will see spaces added between two words.

So, That's it for this tutorial.


Note:- Try to create you own web page examples for practice. later on we will see how to add your web pages on google.

No comments:

Post a Comment