Breaking News

How to Learn HTML




              How to Learn HTML

HTML is the abbreviation for Hyper Text Markup Language, and is the code, or language that is used for the creation of basic website layouts. It can look a little daunting if you've never done any coding before, but all you need to try it out is an ordinary text editing application and an internet browser. You might even recognize some HTML used to change text in online forums, customized online profiles, or even some wikiHow articles. HTML is a useful tool for anyone who uses the internet, and learning the basics may take you less time than you think.

Part 1
Learning Basic HTML

  1. Image titled Learn HTML Step 1
    1
    Open an HTML document. Most text editing programs, including Notepad or Notepad++ for Windows, TextEdit for Mac, and gedit for GNU/Linux can be used to write HTML documents. Open a new document and use FileSave As in the top menu to save it as a "Web Page," or to change the file extension to ".html" instead of ".doc," ".rtf," or any other extension.
    • You may see a warning that your document will be changed to "plain text" instead of "rich text," or that special formatting and images won't be saved properly. This is fine; HTML documents do not use those options.
  2. 2
    View your document with an internet browser. Save your blank document, then find the document icon in your computer and double click to open it. It should open as a blank web page in your browser. If it doesn't, drag the file icon to the URL (address) bar of your browser. As you edit your HTML document in this tutorial, you can keep checking back and seeing how your web page changes.
    • Note that this does not actually create a website online. It will not be accessible by other people, and you do not need an internet connection to test out. This just uses a browser to "read" your HTML document as though it were a website.
  3. 3
    Understand markup tags. Markup tags do not show up on a web page like normal text. Instead, they tell your web browser how to display the page and its content. The "start tag" contains instructions. For example, it might tell the browser to display text as bold. You also need an "end tag" to let the browser know where the instructions apply: in this example, all text between the start tag and the end tag will be bold. Write end tags inside angle brackets as well, but start with a slash after the first bracket.
    • Write start tags in between angle brackets: <start tag goes here>
    • Write end tags in between angle brackets, but put a slash after the first bracket: </end tag goes here>)
    • Keep reading to learn how to write functional markup tags. For this step, all you need to remember is the basic format they are written in: < > and </ >
    • If you are using other HTML tutorials as well, you might see them refer to the tags as "elements" and the text in between start and end tags as "element content."
  4. Image titled Learn HTML Step 4
    4
    Write your first tag. Every html document starts with a tag and ends with a
tag. This tells the browser that everything between these tags is in HTML. Add these tags to your document:
  • Often, HTML files are started with a line that indicates that the file as a whole should be read as a HTML file by browsers. It isn't needed, but may help resolve compatibility issues.
  • Write at the top of your document.
  • Hit enter or return several times to give yourself some space, then write

  • Remember to write everything else in this tutorial in between these two tags.
  • Image titled Learn HTML Step 5
    5
    Fill out the portion of your document. In between the and tags, write a start tag and a
  • end tag. Give yourself space to write between them. Everything in between these head tags won't actually be displayed on the page itself. Try the following and see where it shows up instead:
    • In between the and tags, write </b> and <b>
    • In between the and tags, write How to Learn HTML - wikiHow.
    • Save the document and open it in a browser (or save the document, then refresh the browser page if it's already open.) Do you see what you wrote at the top of the browser, above the address bar?

  • Image titled Learn HTML Step 6
    6
    Create a section. Everything else in this beginner document will go in a body section, which actually gets displayed on the web page. After the
  • end tag, but before the tag, write and . For the rest of this tutorial, everything you write will go in between these body tags. You should now have a document that looks like this (ignoring the bullet points):
    • How to Learn HTML - wikiHow

  • Image titled Learn HTML Step 7
    7
    Add text in various styles. Now it's time to write something you can actually see in your browser! Anything you write within the body tags will show up in your browser after you save the HTML document and refresh the browser page. Don't write anything with the < or > symbols, however, since your browser will try to interpret it as an HTML instruction instead of normal text. Try writing Hello world! (or anything else you like), then add these new tags around it and see what happens each time:
    • Hello world! will show up as "emphasized text:" Hello world!
    • Hello world! will show up as "strong text:" Hello world!
    • Hello world! will show up with a strikethrough: Hello world!
    • Hello world! will show up as superscript: Hello world!
    • Hello world! will show up as subscript: Hello world!
    • Try combinations of these: What does Hello world! look like?
    •  
  • Image titled Learn HTML Step 8
    8
    Divide your text into paragraphs. If you try to write several lines of text in your HTML document, you might notice that the line breaks don't show up in your browser. You have to code these in yourself:
    • This is a separate paragraph.
    • This sentence is followed by a line break.
      before this sentence begins.

      This is the first tag you've seen that doesn't need an end tag! These are called "empty tags."
    • Make headings to display the names of sections:

      header text

      : the largest header

      header text

      (the 2nd level header)

      header text

      (the 3rd level header)

      header text

      (the 4th level header)
      header text
      (the smallest header)
  • Image titled Learn HTML Step 9
    9
    Learn how to make lists. There are several different ways to write lists on your webpage. Try out the following types of code and see which one you like. Note that one pair of tags goes around the whole list (such as the
      and
    tags for "unordered list"), while individual items on the list are surrounded by another pair of tags, such as
  • and
  • .
    • Use this code to make bulleted lists:
      • One item
      • Another item
      • Another item
    • Or this code to make numbered lists:
      1. Item 1
      2. Item 2
      3. Item 3
    • Or this code to make a list defining terms:
      Coffee
      - Hot Beverage
      Leite
      - Cold Beverage
  • Image titled Learn HTML Step 10
    10
    Spruce up your page with line breaks, horizontal lines, and images. Now it's time to try adding things besides text to your page. Try out the following tags, or click the links for more information. You'll need to use an online image hosting service so you have a URL to link to in the image tag:
  • Image titled Learn HTML Step 11
    11
    Link to other places on the page. You can also use this code to link to other pages and websites, but for now, since you may not have a web site yet, we'll focus on "anchors," or specific places on the page that you can link to:

  • Part 2
    Learning More Advanced HTML

    1. Image titled Learn HTML Step 12
      1
      Learn about attributes. Attributes are placed within the tag itself, making additional alterations to the "element content" between the start and end tag. They never stand alone. They are written in the format name="value", where name is the name of the attribute (for instance "color"), and value describes this specific instance (for instance "red").
      • You've actually seen attributes before, if you followed the tutorial in the basic HTML section. tags use the src attribute, anchors use the name attribute, and links use the href attribute. See how those all follow the ___="___" format?
    2. Image titled Learn HTML Step 13
      2
      Experiment with HTML tables. Making a table, or chart, requires several different tags. Play with these tags, or learn about HTML tables in more detail.
      • Start with table tags around the entire table:
      • Row tags around the contents of each row:
      • Column headers in the first row:
      • Cells in subsequent rows:
      • Here's an example of how it all fits together:

        Column 1: MonthColumn 2: Money Saved
        January$100
    3. Image titled Learn HTML Step 14
      3
      Learn the miscellaneous head tags. You've already learned the tag, which shows up at the start of each document. Besides the tag, it can include the following types of tags: <ul> <li> <a href="http://www.wikihow.com/Use-Meta-Tags" title="Use Meta Tags">Meta tags</a>, which are used to provide <i>metadata</i> about a web page. This data can be used by search engines when the robot scours the internet to locate and list websites. To make your website more visible on search engines, use one or more <meta> start tags (no end tags necessary), each with exactly one name attribute and one content attribute, for example: <meta name="description" content="write a description here">; or <meta name="keywords" content="write a list of keywords, each separated by a comma"></li> <li><link> tags are used to associate other files with the page. This is mainly used to link to <a href="http://www.wikihow.com/Learn-CSS-Code" title="Learn CSS Code">CSS stylesheets</a>, which are made using a different type of coding to alter your HTML page by adding color, aligning your text, and many other things.</li> <li><script> tags are used to link the page to <a href="http://www.wikihow.com/Use-JavaScript-Injections" title="Use JavaScript Injections">JavaScript</a> files, which can cause the page to change as the user interacts with it.</li> </ul> <p class="separator" style="text-align: center; clear: both;"> <img style="margin-left: 1em; margin-right: 1em; background-color: rgb(178, 178, 178); background-image: url("https://i.ytimg.com/vi/hrZqiCUx6kg/0.jpg"); background-position: center center; background-repeat: no-repeat; width: 320px; height: 266px;" id="BLOG_video-hrZqiCUx6kg" src="https://img1.blogblog.com/img/video_object.png" data-embed-url="https://www.youtube.com/embed/hrZqiCUx6kg" class="tr_noresize tr_placeholder YOUTUBE-iframe-video BLOGGER-object-element"></p> <p>  </p> </div> </li> <li class="hasimage"> <div class="mwimg largeimage floatcenter " style="max-width:728px"> <a href="http://www.wikihow.com/Learn-HTML#/Image:Learn-HTML-Step-15.jpg" class="image lightbox" data-href="/Image:Learn-HTML-Step-15.jpg?ajax=true&aid=112504"><img alt="Image titled Learn HTML Step 15" class="whcdn" id="img_91254ae4b8" data-src="http://pad3.whstatic.com/images/thumb/d/d6/Learn-HTML-Step-15.jpg/aid112504-v4-728px-Learn-HTML-Step-15.jpg" src="http://pad3.whstatic.com/images/thumb/d/d6/Learn-HTML-Step-15.jpg/aid112504-v4-728px-Learn-HTML-Step-15.jpg" style="" width="728" height="546"></a> </div> <div class="step_num"> 4</div> <a name="step_2_4" class="stepanchor"></a><div class="step"> <b class="whb">Play around with HTML found on websites.</b> A great way to expand your knowledge is by looking into the HTML source of webpages. You can do this by right clicking the page and selecting "View Source," "View Page Source," or a similar option, or by going to the <i>View</i> section in the top menu of your browser. Try to figure out what each unfamiliar HTML tag does, or look it up online for the answer. <ul> <li>While you cannot edit other people's web sites, you can copy the HTML you find into your own document, then play with it to see what different options do. Note that, without the <a href="http://www.wikihow.com/Learn-CSS-Code" title="Learn CSS Code">CSS stylesheet</a> that website links to, you may not be able to see all of the colors or formatting.</li> </ul> </div> </li> <li class="hasimage final_li"> <div class="mwimg largeimage floatcenter " style="max-width:728px"> <a href="http://www.wikihow.com/Learn-HTML#/Image:Learn-HTML-Step-16.jpg" class="image lightbox" data-href="/Image:Learn-HTML-Step-16.jpg?ajax=true&aid=112504"><img alt="Image titled Learn HTML Step 16" class="whcdn" id="img_bff6aa4a85" data-src="http://pad1.whstatic.com/images/thumb/d/d6/Learn-HTML-Step-16.jpg/aid112504-v4-728px-Learn-HTML-Step-16.jpg" src="http://pad1.whstatic.com/images/thumb/d/d6/Learn-HTML-Step-16.jpg/aid112504-v4-728px-Learn-HTML-Step-16.jpg" width="728" height="546"></a> </div> <div class="step_num"> 5</div> <a name="step_2_5" class="stepanchor"></a><div class="step"> <b class="whb">Learn more advanced web design from comprehensive guides.</b> There are various resources on the internet that you can use to learn about many more HTML tags, such as <a rel="nofollow" class="external text" href="http://www.w3schools.com/html/default.asp">W3Schools</a> or <a rel="nofollow" class="external text" href="http://www.codecademy.com/">Codecademy</a>. You may also find books with tutorials about HTML, but make sure you use one that was published within the last couple years, since there are occasional updates and changes. Better yet, <a href="http://www.wikihow.com/Learn-CSS-Code" title="Learn CSS Code">learn CSS</a> to have much more control over your web page's layout and appearance. Once you have CSS down, the next step for web designers is typically Javascript. </div> </li> </ol>

    No comments