10 CA HTML Notes Full
10 CA HTML Notes Full
HTML is a markup language that helps to create the content of a web page using
different commands.
Why HTML?
1.
1. HTML is needed to develop a web page or website.
2. If you are looking for a career in web designing or web development in
the future, HTML is the first step.
3. To understands search engine and landing information.
4. It helps to understand the scripting language, which is very important
for web designers or web developers.
5. It helps to create design templates and themes for different websites.
Requirements of HTML
For learning requirement you need to understand the following:
For writing code and display results you need to understand the following:
• Text editor: A software that is used to write the code. For example, Notepad,
vim editor, notepad++, etc.
• Web browser: A web browser is a program that is used to display the web
page. It works as a platform for HTML that compiles your code and displays
the output. For example google chrome, Mozilla Firefox, internet explorer, etc.
So for HTML, we will use notepad as a text editor and any chrome browser for the
result display.
• Text editor
• Browser
• Folder window where you save your files
Remembers these short cut keys for quick navigation and helpful during writing
HTML and viewing results.
So now to write HTML code you need to understand the structure of the HTML page.
• Head: Contains the information related to your page heading which is mostly
not visible to users but useful for search web browser and WWW
• Body: Contains the information or original contents to be displayed on your
web page
An HTML page structure has few tags. These tags must be written for each and
every page.
There are four main tags used for HTML page structure:
• HTML: Every page starts with <HTML> and ends with </HTML>. The entire
HTML code must be written in between these two tags.
• HEAD: It specifies the head or header of the page. Most part of this tag is not
directly visible to the user. It plays an important role in a web page. It helps to
divide the page, write different scripts, writing styles, and link different external
documents for the HTML web page.
• TITLE: It displays a page title on title bar the web browser and very important
for the search engines to display information on WWW.
• BODY: It is the main area of the page. Whatever you want to display on the
page, you must write in this section.
Now be ready for your first HTML page is here with a single line output:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<body>
Welcome to HTML.
</body>
</HTML>
• When you write a starting tag, immediately press enter and write ending tag
as well if your tag is a container tag. Then write the required tags or code in
between.
• HTML is case insensitive language. It means that whether you write a tag in
capital letters or small letters everything is accepted without error. You can
check in my code, as I wrote a few HTML tags in the capital, few in small
letters.
• Whatever content you want in a specific block or under the tag that must be
written in a proper sequence. Means if you write anything after </html> or
</body> it has no meaning.
Type above code in notepad, don’t try to do copy paste as you are learning. Type the
code. If possible try to give indentation for tags to write as blocks like this:
<html>
<head>
</head>
</body>
</html>
Saving HTML file
After completion of the above code typing, now it’s required to be saved. Follow
these steps to save the file:
Or open notepad and use open command. Select all files in all files option available
next to the filename in the file open dialog box.
Attribute
An attribute is a property name that adds more functionality to the content enclosed within a
tag. The attribute is written next to the tag name.
Value
Value refers to the property value which can be applied to the attribute of an HTML element.
Value must be provided next to attribute with equals to (=) sign. Then written into double
quotes.
In the above example body is tag, bgcolor is attribute and “blue” is value. Every HTML tag
starts with an angular bracket then tag name, then attribute (if required) then value.
In the next section of Basic HTML Elements Class 10, we will discuss some basic
tags.
dir Attribute
This tag specifies the direction of the text in the document. It can be either left to right or right
to left. The values can be ltr (left-to-right) or rtl (right-to-left).
For example,
<HTML dir="ltr">
LANG Attribute
It specifies the language used in HTML document. Mostly the value is the first two initial
letters of the language used in the web page.
For example,
<HTML lang="fr">
If you want to know more values for lang attribute click here.
Output
The title tag in HTML
Background
The background attribute is used to apply or change the background image of your
webpage.
For example,
<html>
<head>
</head>
<body background="back-img.jpg">
Your contents goes here.
</html>
When you are using an image as background following points should be taken care of:
1.
1. The image must be copied into the same folder where you want to save your
HTML file.
2. Write an image name with an extension. Check the properties of the image to
view the extension.
3. All browsers did not support displaying a background image with this
attribute.
4. You must ensure that the text colour and background image colour should be
used in such a way that the user can read the text properly.
5. The image extension must be provided with your file name.
bgcolor
This attribute is also related to the background color of the webpage. The value can be any
color name or color code. The color code is made up of the hexadecimal code with #rrggbb
format. You can use the color code for light or dark color combinations. Let’s have look on
this code:
Note: The hexadecimal code is using 0 to 9 digits and A to F letters such as #0011DD.
<html>
<head>
<title>Background Color Demo</title>
</head>
<body bgcolor="blue">
Your contents goes here.
</html>
Output
Text
This attribute changes the color of text written into the webpage. The text which is not a part
of any other element or formatting styles can be displayed with the given color.
For example,
<html>
<head>
<title>Background Color Demo</title>
</head>
<body bgcolor="blue" text="white">
Your contents goes here.
</html>
Output
link
This attribute is used to change the color of the link text in the web page. The detailed
explanation I will cover in the anchor tag section later. By default it is blue.
alink
This attribute is used to change the color of an active link text. Active links are those link
which is in use currently. When you click on the link and press the mouse on the link this
color is displayed on the text.
vlink
This attribute changes the color of the visited link text. By default the visited link color is
purple.
<html>
<head>
<title>br demo</title>
</head>
<body>
This is my webpage.
I have created my web page using HTML.
Learning web page designing is quite interetring.
</html>
<html>
<head>
<title>br demo</title>
</head>
<body>
This is my webpage.
<br>
I have created my web page using HTML.
<br>
Learning web page designing is quite interetring.
</html>
Output
Attributes of HR tag
HR can have the following attributes:
1. Color: It is used to apply color to HR. The value can be any color name or color code.
2. Size: It is Used to change the height of HR. It can be in number or %.
3. Width: It is used to change the width of HR. It can be in number or %.
4. Align: It is used to change the alignment of HR.
<html>
<head>
<title> HR tag</title>
</head>
<body>
Welcome to my blog - TutorialAICSIP.
<hr color="red" size=5 width="50%" align="left">
This website provides you study material for Artificial Intelligence,
Computer Science, Inoformatics Practices, Information technology and
Computer Applications.
</body>
</html>
Output
In the next section of HTML formatting tags class 10, you will learn how to insert
comments.
Inserting comments
Comments are additional text required to describe some tags or to write explanatory of the
specific tags in the HTML web page. Comments in HTML page starts with <!–Comment
Text–>. Comment text is not displayed in the output.
The next section of HR tag for HTML formatting tags class 10 talks about the heading tags.
Output
Headings in HTML
The <i> tag is used to apply an italics affect the enclosed text.
Lists in HTML
Lists are an important part of a document. Whether it is a word document or pdf document or
web document. It adds functionality to understand the contents clearly. In your textbook you
have seen the list of questions, points are listed in numbers or symbols!
This information makes your text and document contents more attractive and readable. So
now questions coming into your mind about how to use lists in HTML? Don’t worry, in the
next paragraph, you will learn that! Before that let understands about types lists supported
by HTML.
In the next section of lists in HTML class 10 you will learn types of lists it HTML.
Types of Lists in HTML
HTML support three types of lists basically. They are:
1.
1. Ordered (Numbered) Lists – A list with numbers.
2. Unordered (Bulleted) Lists – A list with symbols or bullets
3. Description (Definition) Lists – A list to write definitions or terminologies.
1.
1. OL: The ordered lists always starts with <ol> and ends with </ol>.
2. LI: LI tag specifies list items and written between <ol> and </ol>. For a
number of the list items, the same number of <li> tags are required.
Example:
<html>
<head>
<title>Ordered List in HTML</title>
</head>
<body>
<h1>Subjects we offer:</h1>
<ol>
<li>Computer Science</li>
<li>Informatics Practices</li>
<li>Information Technology</li>
<li>Compueter Applciations</li>
<li>Artificial Intelligence</li>
</ol>
</body>
</html>
Output
1. type : It specifies the type of list. Such lists types are a,A,i,I.
2. start: It is the value of starting point for the list.
Observe this code:
<html>
<head>
<title>Ordered List in HTML</title>
</head>
<body>
<h1>Subjects we offer:</h1>
<ol type="a">
<li>Computer Science</li>
<li>Informatics Practices</li>
<li>Information Technology</li>
<li>Compueter Applciations</li>
<li>Artificial Intelligence</li>
</ol>
</body>
</html>
Output:
An unordered list has a type attribute only. It supports three types of bullets:
1.
1. Disc: This default type of bullets in HTML.
2. Circle: You can change the type in the circle which is coming like disc only
but without any fill color.
3. Square: It displays the list with square filled bullets.
<html>
<head>
<title>Unordered List with circle type</title>
</head>
<body>
<h1>Subjects we offer:</h1>
<ul type="circle">
<li>Computer Science</li>
<li>Informatics Practices</li>
<li>Information Technology</li>
<li>Computer Applications</li>
<li>Artificial Intelligence</li>
</ul>
</body>
</html>
Output
1.
1. DL: It is used to start and end the description list.
2. DT: It is used to write the term or word for the definition.
3. DD: It is used to write the data or descriptive text for the term.
<html>
<head>
<title>Descrition List</title>
</head>
<body>
<dl>
<dt>HTML
<dd>Hpyertext markup language is used to create the static webpage.
</dt>
</dl>
</body>
</html>
Insert Images in HTML
For computer applications, I have covered Unit 1 Networking, HTML Basics, HTML
Basic Elements, and HTML formatting tags in previous articles. In this article, I am
going to discuss Images in HTML.
Topics Covered
shot:
The folder looks like this after copying all images:
If you are using windows OS you can’t see the extension automatically. You need
to make it visible by following these steps (For window 7 or later):
5. Click on OK Button.
Now you are ready to insert image in your HTML document. The <img> tag has
one attribute i.e. src which take the file location including file name as value. Look
at the following code:
<html>
<head>
<title>Images in HTML</title>
</head>
<body>
To insert images use img tag.
<img src=”imagestulips.jpg”>
</body>
</html>
After saving this file my folder looks like this:
Now you can change the image layout by using different attributes of image tag.
Attributes of <img>
1. Src: Specifies the path of file inserted as images.
Width: It is used to change the horizonal pixels of image. The default value is in
pixel. It can be set in pixels, pt, cm or %.
2. Height: It is used to change the vertical pixels of image.
3. Border: It is used to change/apply the border/frame to the image. The value can be
in pixels.
4. HSpace: It is used to apply horizontal space between text and image.
5. Align: It is used to place the image at relative position with text.
6. Alt: It is used to provide descriptive text for the image. This text is displayed when
user moves mouse over the image.
Observe the following code:
<html>
<head>
<title>Images in HTML</title>
</head>
<body>
To insert images use img tag. The img tag has one attribute i.e. src which take the
file location including file name as value.
<img src=”imagestulips.jpg” width=”300″ height=”300″ border=”1″ Hspace=20
alt=”tulips are very beautiful flowers”>
</body>
</html>
Output
shot:
The folder looks like this after copying all images:
If you are using windows OS you can’t see the extension automatically. You need
to make it visible by following these steps (For window 7 or later):
5. Click on OK Button.
Now you are ready to insert image in your HTML document. The <img> tag has
one attribute i.e. src which take the file location including file name as value. Look
at the following code:
<html>
<head>
<title>Images in HTML</title>
</head>
<body>
To insert images use img tag.
<img src=”imagestulips.jpg”>
</body>
</html>
After saving this file my folder looks like this:
Now you can change the image layout by using different attributes of image tag.
Attributes of <img>
1. Src: Specifies the path of file inserted as images.
Width: It is used to change the horizonal pixels of image. The default value is in
pixel. It can be set in pixels, pt, cm or %.
2. Height: It is used to change the vertical pixels of image.
3. Border: It is used to change/apply the border/frame to the image. The value can be
in pixels.
4. HSpace: It is used to apply horizontal space between text and image.
5. Align: It is used to place the image at relative position with text.
6. Alt: It is used to provide descriptive text for the image. This text is displayed when
user moves mouse over the image.
Observe the following code:
<html>
<head>
<title>Images in HTML</title>
</head>
<body>
To insert images use img tag. The img tag has one attribute i.e. src which take the
file location including file name as value.
<img src=”imagestulips.jpg” width=”300″ height=”300″ border=”1″ Hspace=20
alt=”tulips are very beautiful flowers”>
</body>
</html>
Output
HTML forms are set of different form elements that allow to interact with the
user by your HTML web page and collect the data and information from user.
1. Textbox : It is used to user allow to enter a single line text field in HTML forms.
Textfield is mostly used to collect Names or any single value in forms.
2. TextArea: It is used to collect multi-line text entries in HTML forms. This field is used
to accept the address field in a form.
3. Password: It is similar to the textbox field but the characters are displayed in a
special symbolic form when the user enters them. As its name, it is used to collect a
password from the user.
4. Radio Buttons: These fields are used to accept a single value from given multiple
choices or options. It looks like a circle with a dot when selected. For example, select
gender, stream like science, commerce, and humanities, etc.
5. Checkbox: It is used to select multiple choices from a given set of values. It is
coming in a square box with a tick mark in front of it when selected. For example
hobbies, subjects etc.
6. Combobox: It also provides a list but with a drop-down list. It means when users
click on the small arrow coming to next to the dropdown it will expand to downwards
and display the list.
7. Button: Buttons are used to submit or save the data as well as clear the enterd data
into form.
Example:
The input tag is used to insert a textbox in HTML form. It has following attrinutes:
Output
TextArea
To insert a textarea, <textarea> is used with below given syntax:
Example:
Output
Password
Password field allows to accept password from keyboard. the syntax is as following:
<inpyt type=”password”>
Example:
<input type=”password”>
Output
Radio Button
Radio button allows to insert a circle button to select only one choice from given set
of values. The syntax is as following:
Example:
1. name: When you want to allow to select a single value, you have give same name to
all radio buttons in the form.
2. value: It saves the text written as value into the database when submit button is
clicked.
3. checked: If you want to display the checkbox should be selected automatically when
your HTML page loads in the browser, you can use this attribute.
Output:
Checkbox
As we have already discussed that checkbox allows to select multiple values from
given choices. The syntax is almost similar like radio button. So let us take an
example:
<input type=”checkbox” name=”gen” value=”Plying Cricket” checked>Plying Cricket
<input type=”checkbox” name=”gen” value=”Reading Books”>Reading Books
Output
Combobox
To create combobox you need to combine two tags in HTML form.
Example:
<select>
<option> January
<option> February
<option> March
</select>
Output
Button
There are three types of buttons:
Example:
<input type=”submit” value=”Save”>
Output
1. Action: This accept the file name or page should be redirected after click on the
button.
2. Method: This specifies how the data will be saved either get or post after click. The
value get means getting data and post means sending data through the form into
server.