Professional Documents
Culture Documents
JAIPUR
</body>
</html>
Output
Html Tags
All HTML documents should have html, head and body tags,
along with the DOCTYPE identifier.
!DOCTYPE –-
Tells the browser which set of standards the page
adheres to
<html>…</html> --
Surrounds the contents of the entire page •
<title>…</title> --
Gives the name of the page that appears in the top of
the browser window •
<body>…</body> --
Frames the content of the page to be displayed in
the browser.
Some Common HTML Tags an their Meaning
Some Attributes
Tag Description
Tag Description
The class attribute is often used to point to a class name in a style sheet. It can also be used
by a JavaScript to access and manipulate elements with the specific class name.
The Syntax For Class
To create a class; write a period (.) character, followed by a class name. Then,
define the CSS properties within curly braces {}:
Multiple Classes
To define multiple classes, separate the class names with a space, e.g. <div
class="city main">. The element will be styled according to all the classes
specified.
Example
<!DOCTYPE html>
<html>
<head>
<style>
.city {
background-color: tomato;
color: white;
border: 2px solid black;
margin: 20px;
padding: 20px;
}
</style>
</head>
<body>
<div class="city">
<h2>London</h2>
<p>London is the capital of England.</p>
</div>
<div class="city">
<h2>Paris</h2>
<p>Paris is the capital of France.</p>
</div>
</body>
</html>
Output
HTML page structure
Structure of a Webpage
Cascading Style Sheets
What is css ?
Inline CSS ;
External CSS
• IT USES THE ID ATTRIBUTE OF THE HTML ELEMENT AND DEFINED WITH A “#”.
<script>
Document. getElementById("demo").innerHTML = "My First JavaScript";
</script>
JAVASCRIPT IN <BODY>
<HTML>
<BODY>
<SCRIPT>
DOCUMENT.WRITE(“<p> THIS IS A PRAGRAPH</p>”);
</SCRIPT>
</BODY>
</HTML>
JAVA SCRIPT KEY WORDS
Keyword Description
var Declares a variable
1. Number(22,29,12)
2.String( C,abc)
3. Boolean(true/false)
4. Object(properties & Methods
5.Undefined(no data type defined
A simple JavaScript example
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>
Output
JavaScript HTML DOM
(document object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects: