Web Programming HTML Notes
Web Programming HTML Notes
Web Programming
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Unit 1 - HTML
Fundamental Elements of HTML, Formatting Text in HTML, Organizing
Text in HTML, Links and URLs in HTML, Tables in HTML, Images on a
Web Page, Image Formats, Image Maps, Colors, FORMs in HTML,
Interactive Elements, Working with Multimedia - Audio and Video File
Formats, HTML elements for inserting Audio / Video on a web page
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Unit 1 - CSS
Understanding the Syntax of CSS, CSS Selectors, Inserting CSS in an
HTML Document, CSS properties to work with background of a Page,
CSS properties to work with Fonts and Text Styles, CSS properties for
positioning an element
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Unit 1 - Javascript
Using JavaScript in an HTML Document, Programming Fundamentals
of JavaScript – Variables, Operators, Control Flow Statements, Popup
Boxes, Functions – Defining and Invoking a Function, Defining
Function arguments, Defining a Return Statement, Calling Functions
with Timer, JavaScript Objects - String, RegExp, Math, Date, Browser
Objects - Window, Navigator, History, Location, Document, Cookies,
Document Object Model, Form Validation using JavaScript
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
What is HTML?
• HTML stands for Hyper Text Markup Language
• It describes the structure of web page
• It consists of different elements and this elements tell the browser
how to display the content
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<ul>
<li>Web</li>
<li>OS</li>
</ul>
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<ol>
<li>Web </li>
<li>OS</li>
</ol>
</html>
</body>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Links
<html>
<body>
<ul>
<li> <a href="list.html">Home</a></li>
<li>About Us</li>
</ul>
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Images
• The HTML <img> tag is used to embed an image in a web page.
• Images are not technically inserted into a web page; images are linked
to web pages. The <img> tag creates a holding space for the
referenced image.
• The <img> tag is empty, it contains attributes only, and does not have
a closing tag.
• The <img> tag has two required attributes:
• src - Specifies the path to the image
• alt - Specifies an alternate text for the image
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<img src= “demo.png” alt=“demo image” >
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<img src= “demo.png” alt=“demo image”
style="width:500px;height:600px;">
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<img src= "demo.png" alt="demo image"
style="width:500px;height:600px;">
<br>
<img src= "demo.png" alt="demo image" width="300" height="200">
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<html>
<body>
<img src= "demo.png" alt="demo image"
style="width:500px;height:600px;float:right;">
<br>
<img src= "demo.png" alt="demo image" width="300" height="200">
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Image Maps
• The HTML <map> tag defines an image map. An image map is an image
with clickable areas. The areas are defined with one or more <area> tags.
How it works?
• The idea behind an image map is that you should be able to perform
different actions depending on where in the image you click.
• To create an image map you need an image, and some HTML code
that describes the clickable areas.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
The image is inserted using the <img> tag. The only difference from
other images is that you must add a usemap attribute
<img src="demo.png" alt="demo image" usemap="#htmlmap”>
The usemap value starts with a hash tag # followed by the name of the
image map, and is used to create a relationship between the image
and the image map.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
The Areas
• Then, add the clickable areas. A clickable area is defined using
an <area> element.
Shape
• You must define the shape of the clickable area, and you can choose
one of these values:
• rect - defines a rectangular region
• circle - defines a circular region
• poly - defines a polygonal region
• default - defines the entire region
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Shape="rect"
• The coordinates for shape="rect" come in pairs, one for the x-axis and
one for the y-axis.
Shape="circle"
• To add a circle area, first locate the coordinates of the center of the
circle , and then specify the radius of the circle
Shape="poly"
• The shape="poly" contains several coordinate points, which creates a
shape formed with straight lines (a polygon). This can be used to
create any shape.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Background Images
Background Image on a HTML element
• To add a background image on an HTML element, use the
HTML style attribute and the CSS background-image property
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
HTML Forms
• An HTML form is used to collect user input. The user input is most often sent
to a server for processing.
The <form> Element
• The HTML <form> element is used to create an HTML form for user input:
<form>
.
form elements
.
</form>
The <form> element is a container for different types of input elements, such
as: text fields, checkboxes, radio buttons, submit buttons, etc.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname">
</form>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
HTML Video
• The HTML <video> element is used to show a video on a web page.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
How it Works
• The controls attribute adds video controls, like play, pause, and
volume.
• It is a good idea to always include width and height attributes. If
height and width are not set, the page might flicker while the video
loads.
• The <source> element allows you to specify alternative video files
which the browser may choose from. The browser will use the first
recognized format.
• The text between the <video> and </video> tags will only be
displayed in browsers that do not support the <video> element.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
CSS
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
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
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Example :
body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p{
font-family: verdana;
font-size: 20px;
}
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
CSS Syntax
• A CSS rule-set consists of a selector and a declaration block
• The selector points to the HTML element you want to style.
• The declaration block contains one or more declarations separated by
semicolons.
• Each declaration includes a CSS property name and a value, separated
by a colon.
• Multiple CSS declarations are separated with semicolons, and
declaration blocks are surrounded by curly braces.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
H1{
color : blue;
font-size : 12px;
}
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
CSS Selectors
• CSS selectors are used to "find" (or select) the HTML elements you want
to style.
• We can divide CSS selectors into five categories:
1. Simple selectors (select elements based on name, id, class)
2. Combinator selectors (select elements based on a specific relationship
between them)
3. Pseudo-class selectors (select elements based on a certain state)
4. Pseudo-elements selectors (select and style a part of an element)
5. Attribute selectors (select elements based on an attribute or attribute
value)
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
*{
text-align: center;
color: blue;
}
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
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.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Internal CSS
• An internal style sheet may be used if one single HTML page has a
unique style.
• The internal style is defined inside the <style> element, inside the
head section.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Inline CSS
• An inline style may be used to apply a unique style for a single
element.
• To use inline styles, add the style attribute to the relevant element.
The style attribute can contain any CSS property.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Cascading Order
• What style will be used when there is more than one style specified
for an HTML element?
• All the styles in a page will "cascade" into a new "virtual" style sheet
by the following rules, where number one has the highest priority:
1. Inline style (inside an HTML element)
2. External and internal style sheets (in the head section)
3. Browser default
• So, an inline style has the highest priority, and will override external
and internal styles and browser defaults.
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper:
VIVEKANAND EDUCATION SOCIETY’S
College of Arts, Science and Commerce
Name of the Teacher: Neha Narne Class: SYCS Subject: Web Programming Paper: