Saturday, May 11, 2019

HTML basic


I hope you read my first blog called Introduction of Web and Web development.

What is HTML?

          HTML stands for Hypertext Markup Language. It is the markup language for creating web pages and web application. HTML elements are the building blocks of HTML pages and there are represented by tags.

HTML Documents

  •   HTML documents are text documents
                Use simply ASCII text files
                HTML file extensions: .html or .htm
  •   You can create HTML documents using
                Notepad              Notepad++ in windows                 TextEdit in MAC OS
  •   You can also use HTML editors
                Dreamviwer       Microsoft FrontPage                      WebStorm

Steps to create the web page

          Step 1: Open Notepad (PC)
                                Windows 8 or later: Open the start screen and type Notepad
                                Windows 7 or earlier: Open Start > Programs > Accessories > 
                                   Notepad
                      Open TextEdit (Mac)
                                Open Finder > Applicaions > TextEdit

         Step 2: Write some HTML
            



        Step 3: Save the HTML Page
                     Select File > Save as
                     Name the file “Firstpage.html”
                     Select save type as "All Files (",")"
                              


       Step 4: View the HTML page in a Web browser
                               Open the saved HTML file in a web browser
              

HTML documents structure

       The HTML document is divided into two parts:
                HEAD : contains information about the document:
                                   Title of the page
                                    Meta tags are used to describe the content
                                    JavaScript and Style sheets links
                BODY : contains the actual content of the document
                                    This is the part that will be displayed in the browser window.


HTML Basic Tags

       The basic structure for all HTML document is simple and should include the following minimum elements or tags.

                <html> - the main container for HTML pages
                <head> - the container for page header information
                <title> - the title of the page
                <body> - the main body of the page
                <h1> - the large heading of the page
                <p> - a paragraph can be included within these tags,

            


       Only content inside the <body> is displayed in a web browser.

Tags

        Some tags have both start tag and the end tag:
                Eg:  <html></html>                          
                       <head></head>
                       <body></body>
                       <p></p>

              Exercise code:
                      <!DOCTYPE html>
                        <html>
                       <head>
                         <title>First Self</title>
                       </head>
                       <body>
                         <h1>My Self</h1>
                         <p>Enter your Name</p>
                           <p>Enter your Birthday</p>
                       </body>
                        </html>

        But some tags don't need a closing tag
                Eg: <br/> - Break the content of web page by horizontal space. 
                      <hr/> - create a Horizontal rule in the page
                      <img/> - insert image in the page
                      <meta/> -  insert meta data to a web page
                      <DOCTYPE/> - Define document type

              Exercise code:
                      <!DOCTYPE html>
                        <html>
                       <head>
                         <title>First Self</title>
                       </head>
                       <body>
                         <h1>My Self</h1>
                           <hr />
                           <img src="Myimage.jpg"/>
                           <br />
                         <p>Enter your Name</p>
                           <p>Enter your Birthday</p>
                       </body>
                        </html>
                     

HTML Attributes

        Attributes provide additional information about an element.
        There are always specified in the start tag.
        Attributes come in name/value pairs like: name=”value”
                Eg: <body name=”container” bgcolor=”yellow”>---</body>

             Exercise code:
                      <!DOCTYPE html>
                        <html>
                       <head>
                         <title>First Self</title>
                       </head>
                       <body name="container" bgcolor="Color">
                         <h1>My Self</h1>
                         <p>Enter your Name</p>
                           <p>Enter your Birthday</p>
                       </body>
                        </html>

<img/> tag

      <img/> tag defines an image in an HTML page.

           Image attributes

  • src
                    Specifies of the URL or file path of the image.
                       <img src="URL/File Path"/>
                     You must include the folder name in the src attribute.

                           File path: 
                                There are 4 types of file path you must know.

                                    1. Image is located in the same folder as the current page.
                                   <img src="flower.jpeg"/>

                                    2.  Image is located in the Images folder in the current 
                                         folder.  
                                        
                                                              <img src="images/flower.jpeg"/>

                                   3.  Image is located in the Images folder at the root of the 
                                        current web.

                                   4.  Image is located in the folder one level up from the 
                                        current folder. 

                           URL or Images on another server
                                  
                                Some web site store images on the image server.
                                      Eg: <img src="https://www.google.lk/url?
sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjchrfxlo7iAhVBPI8KHeW8CnsQjRx6BAgBEAU&url=https%3A%2F%2Fwww.pexels.com%2Fsearch%2Fflower%2F&psig=AOvVaw28RSyiuiFER2xul35-5LPQ&ust=1557470318370672"/>


  • alt
                Provides an alternate text for an image, if the user for some reason 
           cannot view it (because of slow connection, an error in the src attribute, or if 
           the user uses a screen reader.)
                      <img src="URL/File Path" alt="image"/>
  • width and height
               Specify the width and height of the image.
                   <img src="URL/File Path" alt="image" width="50%" height="50%"/>

  • align
               Specify the alignment of the image.
                   <img src="URL/File Path" alt="image" width="50%" height="50%" align="top"/>


       Information which the browser will ignore:

             Tabs, Multiple spaces will appear as a single space, new line

             Comments <! --  -->

                     Browser will not display text in between comment tags.
                                <! -- This is a comment -->

                     Comments can be helpful when your code is read by others and 
                 when debugging html.


             Exercise code:
                      <!DOCTYPE html>
                        <html>
                       <head>
                         <title>First Self</title>
                       </head>
                       <body name="container" bgcolor="Color"><! -- Background color -->
                         <h1>My Self</h1>
                           <hr/>
                           <img src="path of you image" alt="My self" width="20%" height="20%">
                           <br/>
                         <p>Enter your Name</p>
                           <p>Enter your Birthday</p>
                           <h2>Education</h2>
                           <p> Studied at Your school name</p>
                       </body>

                        </html>

I hope you got a basic knowledge of HTML and now you can create simple web page.

See you soon with the HTML text formatting and font tags.      
                    


Sunday, May 5, 2019

Introduction of Web and Web development

Let’s start the journey to web application development.


What is web?
       Web or World Wide Web is the service which runs on top of internet. It consists of information organized into Web pages containing text and graphic images, hypertext links, or highlighted keywords and images that lead to related information.


How does the web work?

Let’s consider about each of above components.

Client – When you use your internet connection to become part of the Web, your
  computer becomes a web client in the worldwide client/server network.

Web browser – It is the software that you run on your computer to make it work as a
                          web client

Web server – It is a program that waits for requests from the web browser.
                       The web server provides 4 major functions
                                  1)  Serving web pages
                                  2)  Running gateways programs (CGI) and returning output
                                  3)  Controlling access to the server
                                  4)  Monitoring and logging all access
            Eg : Apache , IIS , Netscape Web server

Web site – A collection of linked web pages that has common theme or focus. There are
       two types of Web sites.
1)    Static website
It contains web pages with fixed content. It can be built by simply
creating a few HTML pages and publishing them to a Web server
2)    Dynamic website
It contain Web pages that are generated in real times. These pages
include Web scripting code.


Web development
Web development is the work engaged in developing a web site for the internet (largest network in the world that connects millions of individual networks all over the world) or an intranet (a private network that is contained within a enterprise). 
  Web development consists of web engineering, web design, web content development, client side/server-side scripting, web server and network security configuration and e-commerce development.


What are the languages using to develop the web site?
  • HTML (latest version is HTML5), CSS (latest version is CSS3) are the core building blocks of any site.
  • Client-side scripting languages – For site functionality
                      JavaScript
                      ActionScript
                      VBScript
                      Silverlight (for gaming)
  • Server-side scripting languages – For site architecture
                      PHP
                      C#
                      Java
                      Ruby
Python
JavaScript via Node.js
C, C++
Scala
Perl & Perl5
  • Database technology
                     SQL


I hope you got a basic knowledge of what is web and how it works and also the languages use for developing the web site.

See you soon with my next blog HTML Basic