Professional Documents
Culture Documents
Radio button
Example:-
p{ color :Red;}
INCLUDING CSS IN HTML DOCUMENT
Linking to
Linking to
an
an external
imported
Style Sheet
Style sheet
INLINE STYLE SHEETS
Syntax:-
Syntax:
<head>
<link rel=“stylesheet” type=“text/css” href= “url of css file”>
</head>
FOR EXAMPLE
<html> “Rule.css”
<head>
<title>inline stylesheet</title>
</head>
<body> p{
<h2>inline style </h2> color:green;
<hr> font-size:14pt;
<p> }
we shall be learning how the h1 {color:red;}
inline style works. it is very
useful part of html.
</p>
<p style="color:cyan;font-
size:16pt">
we shall be learning how the
inline style works.it is very
useful part of html.
</p>
</body>
</html>
OUTPUT
IMPORTED STYLE SHEET
In addition to linking an external style sheet using
the <link> element,you can also link it using @import
rule. The @IMPORT rule allows users to import style
rules from other stylesheets.
Syntax:
<head><title> title information</title>
<style type=“text/css”>
<! - -
@import URL(cssfilepath);
CSS rules
- ->
</style>
</head>
FOR EXAMPLE
<html>
<head>
<title>import style sheet</title>
<style type="text/css">
<!--
@import(rule.css);
h1{color:blue;}
-->
</style>
</head>
<body>
<h2> import style sheet</h2>
<p>
we shall be learning how the inline style works. it is very useful part of html.
</p>
<h1> heading is blue</h1>
<p>this is the first paragraph of the webpage</p>
<p>this is the second paragraph of the webpage</p>
<b>it will be bold but not green</b>
</body>
</html>
OUTPUT
JAVASCRIPT
<script language=“javascript”>
<! - -
// javascript code
- - ->
- </script>
FUNCTIONS
Syntax:-
function fname([part1],[part2]………[partn])
{
Statement[s];
}
FOR EXAMPLE
<html>
<head>
<title>java1</title>
<script type="text/javascript">
function_myfunction()
{
alert("display a message box");
}
</script>
</head>
<body>
<button type="button" on-click="myfunction()"> click
me </button>
</body>
</html>
OUTPUT
RETURN STATEMENT
The return statement is used to return value
from the function nto the place where the
function was called.it is usually used when you
have to test whether a particular field(s) in the
from are blank or not.
Syntax:
return(value);
FOR EXAMPLE
<html>
<head>
<title>return</title>
<script type="text/javascript">
<!--
function area(side)
{
c=side*side;
document.write("area of square = " +c);
}
-->
</script>
</head>
<body>
<script type="text/javascript">
<!--
area(5);
-->
</script>
</body>
</html>
OUTPUT
SCOPE OF VARIBLES
The variables can either be a local variable or a
global variable. A variable that is defined inside
the functions is known a local variables. It can
only be used within the function in which they
are declared.
The variables that are defined outside the
function are known as global variables.they can
be accessed from anywhere within the webpage.
FOR EXAMPLE
<html>
<head>
<title>scope of variable</title>
<script type="text/javascript">
<!--
num=6;
function display1()
{
var num=4;
document.write("value of loacal variable = " +num);
}
function display2()
{