CA - Unit-3 HTML CSS JS
CA - Unit-3 HTML CSS JS
OUTPUT
Explanation of TAGS
• <HTML>
Describe HTML web page that is to be viewed by a web browser.
• <HEAD> -
This defines the header section of the page.
• <TITLE> -
This shows a caption in the title bar of the page.
• <BODY> -
This tag show contents of the web page that will be displayed.
Types of HTML Tags
• There are two different types of tags
1. Container Element
Container Tags contains start tag & end tag
i.e. <HTML>… </HTML>
2. Empty Element
Empty Tags contains only start tag i.e. <BR>
Text formatting tags
➢ Heading Element :
• There are six heading elements :
<H1>,<H2>,<H3>,<H4>, <H5>,<H6>
• All the six heading elements are container tag and requires a closing
tag.
• <h1> will print the largest heading
• <h6> will print the smallest heading
Heading Tag Code - Text formatting tags
CODE : OUTPUT
Text Alignment Tag
• It is use to change alignment of the text.
1.Left alignment <align=“left”>
2.Right alignment <align=“right”>
3.Center alignment <align=“center”>
Text Alignment Tag
CODE :
Text Alignment Tag
OUTPUT :
HTML Comment Tags
• You can add comments to your HTML source by using the following
syntax:
• Note that there is an exclamation point (!) in the start tag, but not in
the end tag.
• With comments you can place notifications and reminders in your
HTML code:
Heading Tag Code - Text formatting tags
CODE :
OUTPUT
Hyperlink
• HTML uses the <a> anchor tag to create a link to another document or web
page.
• An anchor can point to any resource on the Web: an HTML page, an image, a
sound file, a movie, etc.
• The syntax of creating an anchor: <a href="url">Text to be displayed</a>
✓ The <a> tag is used to create an anchor to link from
✓ href attribute is used to tell the address of the document or page we are linking
to
✓ words between the open and close of the anchor tag will be displayed as a
hyperlink.
Hyperlink
The Target Attribute:
• With the target attribute, you can define where the linked document
will be opened.
• By default, the link will open in the current window.
• alink - sets a color for active links or selected links.
• link - sets a color for linked text.
• vlink - sets a color for visited links - that is, for linked text that you have
already clicked on.
Image source : Google
Hyperlink
Email Links :
• To create an email link, you will use mailto: plus your email address.
• <a href="mailto:Priya.patel42089@paruluniversity.ac.in">Prof. Priya
Patel</a>
Output :
CODE : OUTPUT
Text – Colors in HTML
text - sets a color for the body text.
CODE :
OUTPUT
link– Colors in HTML
link - sets a color for linked text.
CODE :
OUTPUT
HTML Lists
• HTML provides a simple way to show unordered lists (bullet lists) or
ordered lists (numbered lists).
1. Unordered lists
2. Ordered lists
3. Definition lists
OUTPUT
Example : Creating Frames
CODE : TOP FRAME
Example : Creating Frames
CODE : MAIN FRAME
Example : Creating Frames
CODE : BOTTOM FRAME
Example : Creating Frames
OUTPUT
What is CSS?
• CSS stands for Cascading Style Sheets
• CSS describes how HTML elements are to be displayed on screen,
paper, or in other media
• CSS saves a lot of work. It can control the layout of multiple web pages
all at once
• External stylesheets are stored in CSS files
CSS Syntax
• A CSS rule consists of a selector and a declaration block.
p {
color: red;
text-align: center;
}
Three Ways to Insert CSS
There are three ways of inserting a style sheet:
• External CSS
• Internal CSS
• Inline CSS
External CSS
• With an external style sheet, you can change the look of an entire
website by changing just one file!
• Each HTML page must include a reference to the external style
sheet file inside the <link> element, inside the head section.
<html>
<head>
<link rel="stylesheet" href="mystyle.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
External CSS
• An external style sheet can be written in any text editor, and must
be saved with a .css extension.
• The external .css file should not contain any HTML tags.
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Inline CSS
• An inline style may be used to apply a unique style for a single
element.
<h1 style="color:blue;text-align:center;">This is a
heading</h1>
<p style="color:red;">This is a paragraph.</p>
</body>
</html>
JavaScript
• JavaScript was initially created to “make web pages alive”.
• Scripts are provided and executed as plain text. They don’t need
special preparation or compilation to run.