TechSmart

Think Technology Think Smart

Breaking

Showing posts with label Basics of HTML. Show all posts
Showing posts with label Basics of HTML. Show all posts

Thursday, May 28, 2020

May 28, 2020

HTML 5 page layout and Navigation

        Hello guys now in this post we are discuss about HTML 5 page layout and Navigation. This post are very interesting so read carefully 

1. Planning the Website Organization


Planning, organizing, and visualizing website and web page layout important than coding using HTML.
  • The web designer should determine the purpose of the website commerce, entertainment, marketing, information, promotion, press march and education, technical support etc.
  • No matter how the site is structured, it is important to keep it cohesive and logical.
  • Establishing a consistent look and feel for the site is rather important regardless of the multitude of functions it serves.
  • User should feel comfortable moving through and traversing through the paper and not feel lost on the website.
  • Even if the website is built in modules, a consistent user interface breed familiarity and generates unanimous feeling. An inconsistent interface may lead to confusion while the user navigates and explores the website.
  • A web designer should audience.

2. Website Organization

Organizing the information and planning the layout to present information is just as important na the information itself. Organizing content or information i grouping similar items in the same place. Information in the website may be organized using various structures like,
  • Tree structure where user can navigate level by level to find appropriate information
  • Pure Linear structure where the webpages are organized using linear progression like a slide show or a tour.
  • Linear Structure with alternatives may allow the user to choose between alternatives as he progresses sequentially to find useful information thereby engaging the user.
  • Linear Structure with options allows the user to skip over the information which is not relevant to him still preserving the general linear path like in case of surveys.
  • Linear Structure with Side Trip may allow the user to explore supplementary information of his interest but later returning to the mainstream which is linear in form of a tree.
  • Grid Style Structure is a spatial organization and is good for related items associated with a particular product line like in case of a catalogue.
  • Mixed Hierarchy is considered by developer for complex websites where different parts of websites are designed using different structures to solve the problems of hierarchies.
  • Pure Web Structure is a tangled mess of links where the organization remains unclear
  • Such a structure has links which are fully connected to each other. If the user is familiar with the data navigation then web form has its obvious benefits.

3. Creating Navigational Links


Wikipedia defines hypertext as a system in which objects like text,  pictures, music, or programs can be creatively linked to each other. Nelson's idea of connecting content through the use of hypertext linking influenced the web developers. With hypertext-linked content, users can transverse information in any order or method they choose, creating their own unique view.
  • Planning site navigation is important and the developers should not rely on navigation cues, options or contextual links.
  • Hypertext is a rich environment the users can access information instantly in a non-sequential manner. Hypertext serves as a navigational aid just like the tables of contents and cross-references, where related content can be consistently displayed alongside.
  • Effective navigation not only includes links to other web pages but also provides cues to the user's location like buttons for logical next and previous location in the website, back, home and information of the current location. HTML allows us to create text-based and attractive graphic-based navigational aids.

Creating Text Based Navigation Bar

A navigation bar helps users browse through and locate information on your site easily. Text-based navigation bar can be built using HTML.
Here's an example of a typical text navigation bar for a commercial site:

Home | Products | Gallery | Career | Feedback | Contact us

This Navigation Bar has several tabs which are underlined to depict that they are links to same or other web pages. In the above example Home tab is not underlined as we are in the home page itself thus as and when you visit a particular link the text navigation bar reflects where you are. When the user clicks on the Gallery link the navigation bar looks like:

Home | Products | Gallery | Career | Feedback | Contact us

Following are the steps to create a text navigation bar:

1. Create a navbar.html file in notepad++
2. Type following code in the editor:
<p>Home | Products | Gallery | Career | Feedback | Contact us </p>
3. Include hyperlinks for each tab using <a> tag as follows:
<p><a href = "home.html">Home</a> | 
<a href = "products.html"> Products</a> | 
<a href - "photos.html"> Gallery </a> | 
<a href = "career.html">Career </a> |
<a href - "feedback.html">Feedback </a>|
<a href = "contact.html">Contact us </a></p>
4. The navigation bar is created and by clicking on each link the user can navigate through the website.

Creating Graphical Navigation Bar


  • Hyperlinks can be provided using attractive graphical objects. Graphical links enhance the appeal of the website.
  • The only disadvantage of graphical objects in that they may take a long time to download. Moreover, graphical elements may be suppressed if the use turn off graphics for the browser. The user may not be able to navigate the other pages in this case.
  • Keeping navigation graphics simple and reusing the same graphical throughout your web site may allow the navigation graphics to be loaded in the user's cache and the server does not have to download it again for subsequent pages.
  • The graphics can be standardized so that they provide predictable navigation cues for the user.
  • Even though graphite-based links enhance the feel of the website, text-base links should also be provided in addition to graphic-based links so even if the graphics or icon are not displayed due to any reason the user can navigate through text-based links.

Text-Based navigation versus Graphic-based Navigation

  • Text-based navigation does not suffer from the overhead of downloading like in the case of graphic-based navigation.
  • Text-based graphics are visible even if the user turns off the graphics of the browser.
  • Text-based graphics work well with all types of browsers.
  • Graphic-based links are more appealing as compared to text-based links.

4. Creating Image Maps 


Pictures, logos, and other graphical effects are placed into a document using and the <IMG> tag. Pictures, graphics and multimedia objects enhance the lock and feel of a website.

<body>
<img src="image.img" alt="photo"/>
</body>

Linking using an Image

The image can be hyperlinked to different sections of the website using:

<a href="gallery.html"><img src="photo.jpg"/></a>

       The above code allows image to be linked to gallery page. Here a single image is linked to single web page. However an image can be multi-linked to various pages using <MAP> and <AREA> tags along with <IMG> tag. This called Image Mapping. If the image mapping is created on the client side then the browser will process the same as is called Client-side.
       Image Mapping where an if created on the server side then it is processed b the server and in called a Server-side Image Mapping.

Following is the code for renting client-side Image map

<lmg width=600 height=120 src="/images/logo.gif " alt ="Welcome to Techsmart Publication" USEMAP="# main"

Here the <IMG >tag has "src" attribute to specify the url of the image which is mapped, "alt" attribute carries information of the alternate content and USEMAP specific client-side map name.. Therefore we include <MAP> tag to include the mapping information.

Attributes of CIMG
  • SRC - Specifies the URL of the image file 
  • ALT - A text-based description of the image content (alternative text).
  • WIDTH and HEIGHT -Gives the width and height of the image in pixels 
  • ISMAP-identifies the image as being used as a part of a server-side imagemap
  •  USE MAP - Not equal to the name of the client-side image map to be use with the image 
Many browser display it as tooltip when mouse is moved over the image 

Image Mapping Tags

<MAP> and<AREA>tag are used to specify mapping information for the image so that it can be multilinked.

Example: 
< MAP NAME="main">
 <AREA SHAPE ="POLY" HREF="product.html" COORDS="35,80,16 8,99.92.145"><AREA SHAPE="CIRCLE" HREF="contact.html" COORDS=" 288306268334 "<AREA SHAPE="DEFAULT" HREF="home.html">
< /MAP >
<MAP> contains HTML tags that define the clickable regions (hot regions) of an image map

Attribute of <MAP>
 NAME - Gives the map information unique name can be referenced by the USEMAP attribute in the <IMG>to that places the image map graphics
<AREA> Defines a hot region in a diet-side image map.

Attributes of <AREA>
  • ALT - Provide a text alternative for the hot region in the event that the image does not load defined SHAPE Specifies the shape of the hot region being defined.
  • Possible values of SHAPE include: REACT . rectangles CIRCLE - circles POLY-polygons DEFAULT - for any point on the image not part of another hot region
  • HREF - Set equal to the URL of the document to associate with the hot region
  • HREFLANG. A two-letter language code that specifies the language of the linked document, e.g., MEDIA - Specifies what media device the target URL is best, eg, Printer, speaker, monitor, etc.
  • REL - Specifies the relationship between target document and current document
  • TARGET - Specifies into which frame to load the linked document 
  • TYPE - Specifies the MIME type of the target URL 
  • COORDS - Specifies coordinates that define the hot region in different shapes as follows:
      Reet xl, y1, x2, y2 coordinates of the top-left comer and the bottom-right corner of the rectangle)          Circle: x, y, radius (coordinates of the circle x and y which will provide us the center and the radius)
     Poly:x1, y1, x2, y2,...... xn, yn coordinates of the edge of the polygon)

Example of Client-side Image Map

<!DOCTYPE HTML>
<HTML>
<BODY>
<IMG WIDTH=400 HEIGHT=SRC=''/images/logo.gif'''  ALT=''Welcome to techmax
Publication''USEMAP=''#main''>
<MAP NAME=''main''>
<AREA SHAPE=''POLY''HREF=''profile.html''COORDS=''35,80,16 8,99,92,145''>
AREA SHAPE=''CIRCLE''HREF=''feedback.html''COORDS=''288,306,288,334''>
<AREA SHAPE=''DEFAULT''HREF=''index.html''>
</MAP>
</BODY>
</HTML>

Example of Server Side Image map :

<!DOCTYPE HTML>
<HTML>
<BODY>
<IMG WIDTH=400 HEIGHT=100 SRC=''/images/logo.gif'  ALT=''Welcome to Techmax
Publication'' ISMAP>
</BODY>
</HTML>

Redirecting to Another URL

  •  A redirect happens when a web page is visited at certain URL, but it changes to a different URL.
  •  For e.g a person tries to visit ''techsmartbooks.com/page-a'' in their browser and he/she is redirected to "Techsmartbooks.com/page-b"  instead.
  • This is very useful if we want to redirect a certain page to a new location change the URL structure of a site like removing "www." portion of the URL or even redirect the users to entirely another website.
  • While designing a website, it is often required to change the location of a web page
  •  However, if the page is visited frequently, users may have already linked to it
  • Moreover, the search engines have already indexed the page. Therefore best to replace your page with a new page that will redirect the users to the new page
  • However, when using this HTML redirect code, make sure that it is not used to trick the Search Engine. There are alternative ways to drive traffic to a desired web site.

<meta HTTP-EQUIV="REFRESH" content=" 2";
url="http://www.techsmartbooks.com/index.html">

  • The above HTML redirects the users another web page instantly Content="2; may be changed to the number of seconds the browser should wait before redirecting.

Thanks for visiting

Tuesday, May 26, 2020

May 26, 2020

What is HTML 5 ?

     Hii there ! its Akash, in this post we are going to learn HTML 5 and its basic structure,  and more.

HTML 5  :-


  • HTML5 is a descendant from HTML, though it has major similarities with some added features and more tags and simplified coding (better for programmers/web developers).
Key Differences
  • Audio and video were not part of previous HTML version specifications; however, both are the integral part of HTML5 specifications.
  • Vector graphics is also an integral part of HTML5 such as SVG and canvas while vector graphics is possible in HTML with the help of various technologies such as VML, Silver-light, Flash, etc.
  • In HTML, browser cache can be used as temporary storage. In case of HTML5, application cache, web SQL database, and web storage is used.
  • HTML doesn't allow JavaScript to run in web browser, it runs in same thread as browser interface. HTML5 allows JavaScript to run in background that is possible because of JS Web worker API in HTML5.
  • HTML works smoothly with all old browsers while most of the modern web browsers have started supporting HTML5 specifications.
  • These browsers include: Firefox, Mozilla, Chrome, Opera, Safari, etc.
  • The aim of HTML5 is to improve the language by support of latest multimedia while keeping it user friendly and easily readable by humans and consistently understood by computers and devices such as web browsers parser, etc.
  • Various other tags are added in HTML5 to enhance the web development and user interaction.

1. HTML 5 Basic Structure

<!DOCTYPE html> 
<html>
 <head>
<meta charset="UTF-8">
 <title>Title of an HTML page </title>
 </head>
<body> 
Contents of the page
</body>
</html>
     In HTML5, the differences is <!DOCTYPE> and <meta charset > declaration.

2. DOCTYPE declaration.



  • The <DOCTYPE> declaration is not an HTML tag. It gives information to the web browser about the version of an HTML pages.
  • A document type declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a web-page) with a document type definition (DTD) for example , the formal definition of a particular version of HTML 1.0 - HTML 4.0).
  • In earlier version of HTML5 i.e. HTML 4.01, the <!DOCTYPE> declaration refers to a DTD(Document Type Definition), because HTML 4.01 was based on SGML.
  • The DTD specifies set of rules for the markup language, so that the web browsers render and interpret the content/information correctly.
  • Since, HTML5 is not based on SGML; it does not require a reference to a DTD (Document Type Definition).

3. <Meta charset>



  • It is divided in two parts <meta> which is a tag and "charset is an attribute of the tag. (We will discuss "attribute" in detail later ahead while learning more tags).
  • <meta> comes from Metadata. Metadata is data (information) about data. i.e. metadata gives the information about the properties of the data or any document, or a file.
  • For example pick up any file in your PC and right click on it and click on the properties tab; what you see is the information about that particular file, i.e file size, author, time created and so further.
  • This is the information about the file or in other words it is the Metadata of that file. The <meta> tag provides metadata about the HTML document; means information about that file."charset" attribute (or character encoding); specifies the character set encoding standard, that specifies the encoding within the first 512 bytes of the HTML5 document.
  • A character encoding tells the computer how to interpret raw O's and l's into• real characters. It usually does this by pairing numbers with characters. There are many different types of coding character sets or encoding standards, one of them is "UTF-8". (i.e.: Unicode Transformation Format - 8 bits),

5. Encoding



  • In the beginning, there was ASCII, and things were simple. But they weren't good, for no one could write in Cyrillic or Thai.
  • So there exploded a proliferation of character encoding s to remedy the problem by extending the characters ASCII could express.
  • This ridiculously simplified version of the history of character e shows us that there are now many character encoding floating around.
  • A character encoding tells the computer how to interpret raw zeros and ones into real characters. It usually does this by pairing numbers with  characters.
  • There are many different types of character encodings floating around the ones we deal most frequently with are ASCII, 8-bit encoding Unicode-based encodings.
  • ASCII is a 7-bit encoding based on the English alphabet.
  1. 8-bit encodings are extensions to ASCII that add a potpourri useful, non-standard characters like é and æ.
  2. They can only add 127 characters, so usually only support one script at a time.
  3. When you see a page on the web, chances are it's encoded in these encodings.
  4. Unicode-based encodings implement the Unicode standard include UTF-8, UTF-16 and UTF-32/UCS-4.
  5. They go beyond 8-bits and support almost every language in the world.
  6.  UTF-8 is gaining traction as the dominant international encode the web.
  • The first step of our journey is to find out what the encoding of your we is. The most reliable way is to ask your browser:
Ref: http://techsmart02.org/docs/enduser-utf8.html)
Note: <meta charset = "UTF-8"> syntax replaces the need for <meta http-equive="content type" content="text/html; charset=UTF-8"> (which was used in earlier versions of HTML), although that syntax is still allowed.

  • This explains the basic difference between HTML and HTML5.
Thank you for visiting my site, have a nice day..

May 26, 2020

Basics of HTML

    Hello guys its Akash, in this post we learn about Basics of HTML and how to structured a HTML page. This HTML coding gives a basic knowledge of web designing so read carefully.

Introduction To HTML:- 


  • Hyper Text Mark-up Language (HTML) is the standard mark-up language  for creating web pages, websites and web applications.
  • First developed by Tim Berners-Lee in 1990, HTML is used to create electronic documents (called pages) that are displayed on the World Wide Web.
  • Each page contains a series of connections to other pages called hyperlinks.
  • In 1980, physicist Tim Berners-Lee, a contractor at CERN, proposed and  prototypes ENQUIRE, a system for CERN researchers to use and share documents.
  • In 1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system. Berners-Lee specified HTML and wrote the browser and server software in late 1990.
  • HTML is the one of the most used mark-up language which our web browsers can recognize.
  • You must have heard about other web programming languages, but in fact they all are channelized through mark-up languages.
  • Mark-up languages are designed for the processing, definition and presentation of text. The language specifies code for formatting, both the layout and style, within a text file.
  • The coding used to specify the formatting is called tag. HTML is an example of a widely known and used markup language.
Are there any other languages than HTML to create web pages?
  • Standard Generalized Markup Language (SGML) - a standard pattern for mark-up languages to which HTML adhere. SGML inspired the creation of HTML and HTML inspired many others.
  • Extensible Markup Language (XML) - a newer standard pattern for mark up languages a restricted form of SGML that is intended to be compatible with it.

1. Working Of HTML


  • To understand that we need to first know how internet works. "Internet"-a short acronym of "Inter network connections". Internet is a connection of several machines via cables, wires, wireless and many other peripheral devices.
  • The files are transferred over the network from one machine to other using electronic signals. HTML files are created in such way that they can travel over the network using electronic signals.
  • The HTML files are hosted on a web server which in a machine kept at remote location which runs 24x7 and keeps rendering the data which is asked by the client machine a client machine means the computer device at the user end).
  • Once the request is processed by the web server, HTML data is sent to the requesting client. This client copies all the HTML files from the server and stores it in the computer memory temporarily.
  • The web browser (like Chrome, Firefox, Edge) then reads these files and interpret its functionality and display the Information over the browser screen.
  • Web browser is application software used to read and interpret the data received in Hyper Text form over the internet.
  • The interpretation of the functionality is understood with help of HTML Tags.

2. HTML Element 


  • HTML elements are the hidden keywords within a web page that define how the browser must format and display the content.
  • These tags have two parts, an opening and a closing part. For example, <html> is the opening tag and </html> is the closing tag.
  • The functionality of the tags is implemented to the data which is written inside the HTML tags i.e. content written between opening and closing of the tag is considered for the HTML tag functionality.
  • The web browser reads these tags and hides them and simply implements its functionality over the text.
  • HTML tags are mainly of two types:
     1. Container Tag : A Container tag is one that activates an effect specific to that tag and has a companion tag which discontinues the effect. e.g., <B>is a container tag that, together with its companion closing tag </B>, causes all text found between them to be rendered in bold. The<B> tag turns on the bold effect and the </B> tag turns it off.
     2. Standalone Tag or Empty Tag : A Standalone tag is one that does not have a companion tag. e.g., the <IMG>tag simply places an image on a page. <IMG> has no effect that was turned on and needs to be turned off, so no companion closing tag is needed.

3. Creating a HTML Document

  • To write HTML document we use a simple Notepad editor, which is readily available with every operating system with different names.
  • Like windows users can use "Notepad", Mac users can use "TextEdit" and so further. There is some special editor software also available in the market like "Notepad++" for windows.
  • You can use these raw editors and write the HTML Tags and Text and save it with the file extension as "html". e.g.: "myfirstfile.html".
  • The operating system recognizes these extensions and assigns the default application software (i.e. Web browser) to open/read the document.
Here is a screenshot of how it works
1. Write the file

2. Save the file with proper ".html" extension.

3. View the output by double clicking the saved file.

4. Structure of an HTML page

  • HTML page is a unlike other pages we use (i.e notebook, MS-Word) like every page has a Title, Header, Body, and Footer. HTML pages have the similar layout.
  • We define a HTML page with some basic structure as given bellow.
           1.   Title                  2.   Head
           3.   Body                 4.  Footer
For implementing this we have to use HTML tags.
   Title tag : <title></title>
   Head tag : <head></head>
   Body tag : <body> </body>
   Footer tag : <footer> </footer>
Note : These tags are not case sensitive so whether we write them in upper or lover case does not matter 
 

  • The structure is most important for tags . As mentioned above, every tags lies between <html></html>tags.
  • The opening and closing of the tag should be taken care of like you can refer in this image.
  • The output shall be displayed in the web browser as shown below:
  • If you can notice the output does not displayed the tags, instead it just displays its functionality. i.e the title went up on the tab, the header is above the body and footer bellow the body.
  • It all happened automatically. Thanks to our web browser who can interpret the tags and displays the output. 
Thanks for reading have a nice day