\(\huge\color{green}{\text{Basic HTML Tutorial}}\)
First let's see what is HTML ? Every webpage you look at is written in a language called HTML. You can think of HTML as the skeleton that gives every webpage structure.We will learn here how to use HTML for creating a webpage.
\(\large\sf \ How \ to \ create \ a \ HTML \ file?\) You just need a basic text editor like Notepad to compose the HTML code. After composing HTML code save the file as .html
\(\bigstar\) The first thing we should do is set up the skeleton of the page. a. Always put <!DOCTYPE html> on the first line. This tells the browser what language it's reading (in this case, HTML). b. Always put <html> on the next line. This starts the HTML document. c. Always put </html> on the last line. This ends the HTML document.
\(\hspace{95pt}\LARGE \sf Basic Terminology\) \(\bigstar\) To learn more HTML, we should learn how to talk about HTML. Already you have seen we use <> a lot \(\bullet\) Things inside <>s are called tags. \(\bullet\) Tags nearly always come in pairs: an opening tag and a closing tag. \(\bullet\) Example of opening tag: <html> \(\bullet\) Example of closing tag: </html> You can think of tags as being like parentheses: whenever you open one, you should close it. Tags also nest, so you should close them in the right order: the most recently opened tag should be the first one closed, like in the example below.
\(\hspace{125pt}\large \sf \ Task \ Time\) Create a HTML file \(\bullet\) Put in the <!DOCTYPE HTML> tag. \(\bullet\) Put in the <html> opening and closing tags. \(\bullet\) Between the <html> tags, write whatever you like. \(\bullet\) Save the Code as .html and open the file from abrowser to see what you've made
Having Problem ? Have a look on the following Screenshots !
\(\large \sf Step \ 1\)
\(\large \sf \ Step \ 2\)
\(\large \sf \ Step \ 3\)
\(\bullet\) Follow Step 1 after opening notepad \(\bullet\) After Step 1 Press Ctrl+S and then do as STEP 2
\(\hspace{60pt}\huge \sf \ Paragraphs \ in \ the \ body \) The body is where you put your content, such as text, images, and links. The content in the body is what will be visible on the actual page. The body goes inside the <html> tags, right after the <head> tags, like this:
\(\bullet\) Inside the body, we can create paragraphs. Each paragraph starts with an opening <p> tag and ends with a closing </p> tag. We can write content in between the tags, like this:
\(\hspace{130pt}\large \color{red}{\sf \ Task \ Time}\) \(\bullet\) Underneath the closing </head> tag, put an opening <body> tag and a closing </body> tag, like in the example above. \(\bullet\) Inside the body, create two paragraphs.
\(\hspace{65pt}\huge \sf More \ about \ headings!\) HTML actually lets us have more than one heading size. There are six heading sizes, where <h1> is the boss and <h6> is puny! <h1> - The CEO <h2> - VP <h3> - Director <h4> - Middle management <h5> - Lowly assistant <h6> - Gets coffee for everyone
\(\hspace{80pt}\huge\sf \ Adding \ images\) You can add images to your websites to make them look fancy. We use an image tag, like so: <img>. This tag is a bit different from the others. Instead of putting the content between the tags, you tell the tag where to get the picture using src. It's also different because there is no ending tag. It has / in the tag to close it: <img src="url". Every image on the web has its own image URL. Simply right-click on an image and choose "Copy image URL." Paste that URL in quotes after src= to insert with your <img> tag.
\(\hspace{100pt}\huge \sf \ Hyperlinks\) What if you wanted to send the user to another part of your website, or another website altogether? You use hyperlinks, or links for short! \(\large \sf \ Example\) <!DOCTYPE html> <html> <head> <title></title> </head> <body> <a href=" http://www.openstudy.com ">My study site</a> </body> </html> \(\bullet\) First, there's an opening <a> tag and that tag has an attribute called href. The href value tells your link where you want it to go, in this case http://www.openstudy.com. \(\bullet\) Then you have a description of your link between your opening <a> and your closing </a> tags. This is what you will be able to click on. \(\bullet\) Finally, you have your closing </a> tag.
this guys deserve medals and i mean 100 of medals cuz its explained brilliant as i know html too i see that hes awsome just medal @Abhisar
Thanx @hari5719 ! and please feel free to mention mistakes (if any).
\(\hspace{90pt}\huge\sf Images \ as\ Link\) First we open our <a> tag and point the href to http://www.openstudy.com/ again. But this time, instead of using text inside the <a> tag, we use an <img> tag. Finally, we have our closing </a> tag. Now when you click on the image, you will be taken to http://www.openstudy.com! Placing one HTML tag inside of another is called nesting. E.g. <!DOCTYPE html> <html> <head> <title></title> </head> <body> <a href="https:/www.facebook.com"><img src=" http://assets.openstudy.com/users/abhisar/avatar/large?1404584138622 "> </a> </body> </html>
Join our real-time social learning platform and learn together with your friends!