Class 8 Computer worksheet of Introduction to HTML
Class 8 Computer worksheet of Introduction to HTML
First developed by Tim Berners-Lee in 1990, HTML is short for Hyper Text Mark Up
Language. HTML is used to create electronic documents (called web pages) that are
displayed on the World Wide Web.
Web page
Website
Web server
Search Engine
A web service that helps you find other web pages, such as Google, Bing, Yahoo,
etc. Search engines are normally accessed through a web browser (e.g. you can
perform search engine searches directly in the address bar of Firefox, Chrome, etc.)
or through a web page.
HTML is the standard markup language for Web pages. HTML elements are the
building blocks of HTML pages. HTML elements are represented by <> tags.
A tag is an element inserted into a document or file that changes the look of content or
performs an action. In simple words a tag is a command in a web page that tells the
browser to do something. Below is an HTML element with an open tag (start tag)
showing the name and attribute and a close tag (end tag) showing a forward slash and
open tag name. HTML tags are element names surrounded by angle brackets:
<tagname>content goes here...</tagname>
a. Container Tags
b. Empty tags
Doctype
The first line of code, <!DOCTYPE html>, is called a doctype declaration and tells the
browser which version of HTML the page is written in. In this case, we’re using the
doctype that corresponds to HTML5, the most up-to-date version of the HTML
language. There are a number of different doctype declarations that correspond to
various versions of HTML.
Head Element
The HTML head element is a container that can include a number of HTML elements
that are not visible parts of the page rendered by the browser. The <title> element is the
only element that is required to be contained within the <head> tags. The content within
this element is displayed as the page title in the tab of the browser and is also what
search engines use to identify the title of a page.
Body Element
There can only be one <body> element in an HTML document because this element is
the container that holds the content of the document. All of the content that you see
rendered in the browser is contained within this element. In the example above, the
content of the page is a headline and simple paragraph.
Nesting
Any content that is in between <!-- and --> is a comment that will not be rendered by the
browser.
Now for building a web site type the HTML code in a plain text editor that is NOTEPAD.
A simple text editor is a good way to learn HTML.
Now type the above html code in notepad and save the document as "index.html”.
CODE OUTPUT
The <br> tag inserts a single line break. It is useful for writing addresses or
poems.The <br> tag is an empty tag which means that it has no end tag.
Example:-
<!DOCTYPE html>
<html>
<head>
<title>HTML br Tag</title>
</head>
<body>
<p>This is before the line break<br> and this after the line break.
</p>This sentence has no line break.
</body>
</html>
Attributes:-
The name is the property you want to set. The value is what you want the value of the
property to be set and always put within quotations. For example <p align = "left">.
Bgcolor
This is the colour of the BG, or BackGround, of your page. You need to put the colour in
as a HEX code, like the rest of these colours. You can type the name of the colour.
bgcolor="#FFFFFF" or bgcolor="yellow"
Note that, even though the default BG is white, you should still code in #FFFFFF,
because older browser's default BG is a nasty grey.
Text
This will change the colour of all the text on your whole page, unless you have changed
the colour manually (find out how in the text section).
<Body text="#000000">
Background
The HTML <body> background Attribute is used to specify the background-image for
the document. If you want to put an image as your background, use this attribute. You
can also link to an image from another site, by giving the entire URL.
Margins
There are two sets of margins on a page, the ones at the sides and the ones at the top
and bottom.
HTML Formatting
HTML Formatting is a process of formatting text for better look and feel. HTML
provides us ability to format text without using style sheets. There are many formatting
tags in HTML. These tags are used to make text bold, italicized, or underlined.
Element Description
<b>- This tag is used to bold the text written between it.
<strong>- This tag tells the browser that the text is important and displays the text
darker than the rest.
<big>- This tag is used to increase the font size by one conventional unit.
<small>- This tag is used to decrease the font size by one unit from base font size.
___________________________________________________________________
d. Write the code to put “just learning” as a comment on the web page.
a. <html><title>abc</title></head><body>Just learning</body></html>
______________________________________________________
b. <html><head><title>abc</title></head><body>Just learning</body><html>
_______________________________________________________
c. <html><head><title><head>abc</title></head>Just learning</body></html>
_______________________________________________________
d. <html><head>abc</head><body>Just learning</body></html>
_______________________________________________________