Basic HTML with respect to class 8
Writing Html Documents –
Tag
Attribute
With respect to class 8 HTML, where to Write Html Code
Structure of HTML Document
Html Elements with respect to class 8 computer lessons
HTML container elements require a starting as well as an ending tag. Some
Examples of container elements are:
…………………..
…………………..
…………………..
…………………..
Attributes of HTML
Background attribute
Background color, Text Color, Link Color
By default, browsers display text in black.
With respect to class 8 computer lessons, if you want to change the color or text (by TEXT attribute), color of links (by LINK attribute), color of active links (by ALINK attribute) and background color (by BGCOLOR attribute ).
Consider the following:
- The background color is teal. (bgcolor = “teal”)
- Text color is magenta.
- Links that have not been visited recently are made yellow (link = “yellow”)
- Links that are currently being clicked on (alink = “lime”)
tag
With respect to class 8 computer lessons, it lets you change the size, style and color of the text – It is generally used for changing the appearance of a short segment of text.
Attributes of tag
(i) size: used to specify the size of the text.
(ii) color: used to change the color of text.
(iii) face: used to change the way of displaying text.
Problem: With respect to class 8 HTML, to display a paragraph on red color in size 4 but its first letter should be of size 7 and of blue color.
Base Font
U
sing the largest font
- With respect to class 8 HTML, this tag lets you define the basic size for the font, the browser will use to render normal document text.
Attribute of
size – its value determines the document’s base font size. It has value between 1 and 7
Problem: To display text by changing base font sizes.
Base Font
This text is being displayed in default font size as no base font size has been set as yet.
This text has base font size =5.
Headings: These are defined with the
Paragraphs –
tag.
This is a paragraph aligned to the left side
This is another paragraph with center alignment
Note: Each paragraph has to be enclosed within angle bracket, failing to do will become one large paragraph. HTML automatically adds an extra blank line before and after a paragraph.
- To end one line, and to jump to the next
tag is used.
Paragraph
Writing a line. I want to write in next line.
I am in a new line.
- To centralize a segment of text, just type the text between
.
For example, the code
Will make text – This is centralized – appear centralized on browser window.
- Tag
- The
tag produces a horizontal line spread across the width of the browser window.
Attributes of
tag
(i) Size
This attribute allows you to set the size of the horizontal rule.
Attributes of
tag
(i) Size
This attribute allows you to set the size of the horizontal rule. Width Attribute of
The length of horizontal rules can be controlled with width attribute.
Problem: With respect to class 8 computer lessons, to display horizontal rules of different widths:
Width of Horizontal Rule
The following two rules have widths of 100 and 200 pixels respectively
Comments <!.... and …..>
- Comment are one type of textual content which appear in your HTML
code, but are not rendered by user’s browser.
- Comments are given between special characters.
- Browsers ignore the text between comment characters.
Line Breaks –
This
is a para
graph with line breaks
The below-given lines show the output of the above syntax:
This
is a para
graph with line breaks
The
tag has no closing tag.
Backgrounds –
Bgcolor –
The lines that are given above – To set background-color black.
HTML Colors –
HTML Lists –
Unordered Lists –
This Code Would Display
|
· Coffee |
|
· Milk |
Ordered Lists –
This Code Would Display
|
1. Coffee |
|
2. Milk |
HTML Links – HTML uses the anchor tag to create a link to another document or web page.
Email Links – To create an email link, you will use mailto: plus your email address.
To add a subject for the email message, you would add ?subject= after the email address.
For example:
HTML Images –
The syntax of defining an image:
Output display:
Recap with respect to class 8 HTML
Hyper Text Markup Language is abbreviated as HTML, to design web pages.
Basic HTML
HTML tags
HTML elements
Headings
Paragraphs
Line Breaks
Backgrounds
Bgcolor
HTML Colors
HTML Lists
Unordered Lists
Ordered Lists
HTML Links
Email Links
HTML Images
Tables
Cell Padding
Cell Spacing
Q.1 |
Which of the following is a paired tag? |
a) | <||| ||| img ||| |||> |
b) | <||| ||| br ||| |||> |
c) | <||| ||| b ||| |||> |
d) | <||| ||| hr ||| |||> |
Q.2 |
URL of the image is specified in __________. |
a) | src tag |
b) | img attribute |
c) | href attribute |
d) | src attribute |
Q.3 |
Which of the following is not an attribute of <||| ||| img ||| |||> ? |
a) | size |
b) | width |
c) | alt |
d) | src |
Q.4 |
Which tag is used to scroll the text in the specified direction? |
a) | Scroll |
b) | Animate |
c) | Movingtext |
d) | Marquee |
Q.5 |
<||| p |||>By default, in which direction does the text scroll in marquee tag?<||| /p |||> |
a) | <||| p |||>left to right<||| /p |||> |
b) | <||| p |||>right to left<||| /p |||> |
c) | <||| p |||>top to bottom<||| /p |||> |
d) | <||| p |||>bottom to top<||| /p |||> |
Q.6 |
<||| p |||>Which attribute is used to change the direction of scrolling?<||| /p |||> |
a) | <||| p |||>scroll<||| /p |||> |
b) | <||| p |||>direction<||| /p |||> |
c) | <||| p |||>alt<||| /p |||> |
d) | <||| p |||>None of theabove.<||| /p |||> |
Q.7 |
Which of these tags indicates the begining of HTMl program? |
a) | <||| ||| HTML ||| |||> |
b) | <||| ||| Title ||| |||> |
c) | <||| ||| /HTML ||| |||> |
d) | <||| ||| Head ||| |||> |
Q.8 |
Which of the following is true? |
a) | Ordered list is unnumbered list |
b) | Type is an attribute of <||| ||| li ||| |||> |
c) | Unordered list items are presented with the bullets. |
d) | <||| ||| ol ||| |||> is an empty tag. |
Q.9 |
<||| p |||>Table can be inserted using ________.<||| /p |||> |
a) | <||| p |||><||| insert |||><||| /p |||> |
b) | <||| p |||><||| table |||><||| /p |||> |
c) | <||| p |||><||| add |||><||| /p |||> |
d) | <||| p |||>< add table ><||| /p |||> |
Q.10 |
Heading in a table can be defined with __________. |
a) | <||| ||| tr ||| |||> |
b) | <||| ||| td ||| |||> |
c) | <||| ||| th ||| |||> |
d) | <||| ||| thead ||| |||> |
Your Score: 0/10