SlideShare a Scribd company logo
<!DOCTYPE html>background
<html>
<body>
<h1>Hello World!</h1>
<button onclick="myFunction()">Setbackground</button>
<script>
functionmyFunction() {
document.body.style.background="#f3f3f3 url('img_tree.png') no-repeatrighttop";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundAttachment
<html>
<head>
<style>
body {
background: #f3f3f3 url('img_tree.png') no-repeatrighttop;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p><b>Tip:</b> Try to to resize the window ifthe scrollbar is not available.</p>
<p><b>Tip:</b> Scroll the page before and after you have clickedthe button.</p>
<button onclick="myFunction()">Setbackgroundimage to be fixed</button>
<br>
<script>
functionmyFunction() {
document.body.style.backgroundAttachment="fixed";
}
</script>
<p>Some text to enable scrolling..
<br><br><br><br>
<br><br><br><br>
</p>
</body>
</html>
<!DOCTYPE html>backgroundColor
<html>
<body>
<h1>Hello World!</h1>
<button type="button" onclick="myFunction()">Setbackground color</button>
<script>
functionmyFunction() {
document.body.style.backgroundColor="red";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundImage
<html>
<body>
<h1>Hello World!</h1>
<button type="button" onclick="myFunction()">Setbackgroundimage</button>
<script>
functionmyFunction() {
document.body.style.backgroundColor="#f3f3f3";
document.body.style.backgroundImage ="url('img_tree.png')";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundPosition
<html>
<head>
<style>
body {
background-image:url('img_tree.png');
background-repeat:no-repeat;
}
</style>
</head>
<body>
<button type="button" onclick="myFunction()">Positionbackgroundimage</button>
<script>
functionmyFunction() {
document.body.style.backgroundPosition="topright";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundRepeat
<html>
<head>
<style>
body {
background: #f3f3f3 url('img_tree.png');
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<button type="button" onclick="myFunction()">Setbackground image to no-repeat</button>
<script>
functionmyFunction() {
document.body.style.backgroundRepeat= "no-repeat";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundClip
<html>
<head>
<style>
#myDIV {
width: 300px;
height:300px;
padding: 50px;
background-color: coral;
background-clip:border-box;
color: white;
border: 5px dotted lightgrey;
}
</style>
</head>
<body>
<p>Click the "Try it" button to setthe background-clipproperty of the DIV elementto "content-
box":</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
Lorem ipsumdolor sit amet, consectetueradipiscingelit,seddiam nonummynibh euismodtincidunt
ut laoreetdolore magna aliquam erat volutpat. Ut wisi enimad minimveniam,quis nostrud exerci
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.backgroundClip="content-box";
}
</script>
</body>
</html>
<!DOCTYPE html>backgroundSize
<html>
<head>
<style>
#myDIV {
border: 1px solid black;
width: 300px;
height:300px;
background: url('smiley.gif') no-repeat;
}
</style>
</head>
<body>
<p>Click the "Try it" button to enlarge the background-size of the DIV element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>Hello</h1>
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.backgroundSize ="60px120px";
}
</script>
</body>
</html>
<!DOCTYPE html>backfaceVisibility
<html>
<head>
<style>
div {
width: 100px;
height:100px;
background: red;
color: white;
-webkit-animation:mymove 2s infinite linearalternate;/* Chrome,Safari, Opera */
animation: mymove 2s infinite linearalternate;
}
/* Chrome,Safari, Opera */
@-webkit-keyframesmymove {
to {-webkit-transform:rotateY(180deg);}
}
@keyframesmymove {
to {transform: rotateY(180deg);}
}
</style>
</head>
<body>
<p>Check/uncheck the checkbox to change the backface-visibilityofthe animated DIV element:</p>
<div id="myDIV">
<h1>Hello</h1>
</div>
<input type="checkbox" onclick="myFunction(this)" checked>backface-visibility
<script>
functionmyFunction(x) {
if(x.checked=== true) {
document.getElementById("myDIV").style.WebkitBackfaceVisibility="visible";//Code for Chrome,
Safari, Opera
document.getElementById("myDIV").style.backfaceVisibility="visible";
} else {
document.getElementById("myDIV").style.WebkitBackfaceVisibility="hidden";// Code for
Chrome,Safari, Opera
document.getElementById("myDIV").style.backfaceVisibility="hidden";
}
}
</script>
<p><strong>Note:</strong> The backface-visibilityandbackfaceVisibilitypropertiesare notsupported
in InternetExplorer9 and earlierversions.</p>
</body>
</html>
<!DOCTYPE html>border
<html>
<body>
<div id="myDiv">Thisisa div element.</div>
<br>
<button type="button" onclick="myFunction()">Setborder</button>
<script>
functionmyFunction() {
document.getElementById("myDiv").style.border="thicksolid #0000FF";
}
</script>
</body>
</html>
document.getElementById("myDiv").style.borderBottom="thicksolid#0000FF";
document.getElementById("myDiv").style.borderBottomColor="red";
<!DOCTYPE html>borderBottomLeftRadius
<html>
<head>
<style>
#myDIV {
border: 1px solid black;
width: 300px;
height:300px;
}
</style>
</head>
<body>
<p>Click the "Try it" button to change the border-bottom-left-radiuspropertyofthe DIV
element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>Hello</h1>
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.borderBottomLeftRadius="25px";
document.getElementById("myDIV").style.borderBottomLeftRadius="25px";
}
</script>
</body>
</html>
<!DOCTYPE html>borderBottomStyle
<html>
<body>
<div id="myDiv">Thisisa div.</div>
<br>
<button type="button" onclick="myFunction()">Setsolidbottomborder</button>
<script>
functionmyFunction() {
document.getElementById("myDiv").style.borderBottomStyle="solid";
}
</script>
</body>
</html>
<!DOCTYPE html>borderBottomWidth
<html>
<head>
<style>
#myDiv {
border-style:solid;
}
</style>
</head>
<body>
<div id="myDiv">Thisisa div element.</div>
<br>
<button type="button" onclick="myFunction()">Change widthofthe bottom border</button>
<script>
functionmyFunction() {
document.getElementById("myDiv").style.borderBottomWidth="10px";
}
</script>
</body>
</html>
<!DOCTYPE html>borderCollapse
<html>
<body>
<table id="myTable" border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$150</td>
</tr>
</table>
<br>
<button type="button" onclick="myFunction()">Collapseborder</button>
<script>
functionmyFunction() {
document.getElementById("myTable").style.borderCollapse ="collapse";
}
</script>
</body>
</html>
<!DOCTYPE html>borderColor
<html>
<head>
<style>
#myDiv {
border: thick solidblue;
}
</style>
</head>
<body>
<div id="myDiv">Thisisa div.</div>
<br>
<button type="button" onclick="myFunction()">Change colorofthe four borders</button>
<script>
functionmyFunction() {
document.getElementById("myDiv").style.borderColor="red";
}
</script>
</body>
</html>
<!DOCTYPE html>borderColor
<html>
<head>
<style>
#myDIV {
border: 15px solidtransparent;
width: 250px;
padding: 10px 20px;
-webkit-border-image:url(border.png) 3030 stretch; /* Safari 5 */
-o-border-image:url(border.png) 3030 stretch; /* Opera 12 */
border-image:url(border.png) 30 30 stretch;
}
</style>
</head>
<body>
<p>Click the "Try it" button to change the border-image propertyof the DIV element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>Hello</h1>
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.WebkitBorderImage ="url(border.png) 30 30 round"; /*
Code for Safari 5 */
document.getElementById("myDIV").style.OBorderImage ="url(border.png) 30 30 round"; /* Code
for Opera 12 */
document.getElementById("myDIV").style.borderImage ="url(border.png) 3030 round";
}
</script>
</body>
</html>
<!DOCTYPE html>boxShadow
<html>
<head>
<style>
#myDIV {
position:absolute;
width: 100px;
height:100px;
background-color: coral;
color: white;
}
</style>
</head>
<body>
<p>Click the "Try it" button to setthe boxShadow property of the DIV element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.boxShadow="10px 20px 30px lightblue";
}
</script>
</body>
</html>
<!DOCTYPE html>display
<html>
<head>
<style>
#myDIV {
width: 500px;
height:500px;
background-color: lightblue;
}
</style>
</head>
<body>
<p>Click the "Try it" button to setthe displayproperty of the DIV elementto"none":</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
This is my DIV element.
</div>
<p><b>Note:</b> The elementwill nottake up any space whenthe displayproperty set to
"none".</p>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.display="none";
}
</script>
</body>
</html>
<!DOCTYPE html>Style cursor Property
<html>
<body>
<p id="myP">Mouse overthis textbefore and after you have clickedthe button below!</p>
<button type="button" onclick="myFunction()">Change cursor</button>
<script>
functionmyFunction() {
document.getElementById("myP").style.cursor= "pointer";
}
</script>
</body>
</html>
<!DOCTYPE html>font
<html>
<body>
<p id="myP">Thisis a paragraph.</p>
<button type="button" onclick="myFunction()">Setfont</button>
<script>
functionmyFunction() {
document.getElementById("myP").style.font="italicbold 20px arial,serif";
}
</script>
</body>
</html>
document.getElementById("myP").style.fontFamily="Impact,Charcoal,sans-serif";
document.getElementById("myP").style.fontFamily="Impact,Charcoal,sans-serif";
document.getElementById("myP").style.fontSize ="xx-large";
document.getElementById("myP").style.fontStyle="italic";
document.getElementById("myP").style.fontVariant="small-caps";
document.getElementById("myBtn").style.height="50px";
document.getElementById("main".style.justifyContent="space-between";
document.getElementById("myBtn").style.left="100px";
document.getElementById("myP").style.letterSpacing="15px";
document.getElementById("myDiv").style.lineHeight="3";
document.getElementById("myList").style.listStyle ="decimal inside";
document.getElementById("myList").style.listStyleImage="url('sqorange.gif')";
document.getElementById("myDiv").style.margin="50px 10px 20px 30px";
document.getElementById("myDiv").style.marginBottom="50px";
<!DOCTYPE html>overflow
<html>
<head>
<style>
#myDIV {
border: 1px solid black;
background-color: lightblue;
width: 300px;
height:210px;
overflow:visible;
}
</style>
</head>
<body>
<p>Click the "Try it" button to change the overflowproperty ofthe DIV element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
Lorem ipsumdolor sit amet, consectetueradipiscingelit,seddiam nonummynibh euismodtincidunt
ut laoreetdolore magna aliquam erat volutpat. Ut wisi enimad minimveniam,quis nostrud exerci
type extra
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.overflow="scroll";
}
</script>
</body>
</html>
document.getElementById("myDIV").style.overflowX="scroll";
document.getElementById("myDIV").style.overflowX="scroll";
document.getElementById("myDiv").style.padding="50px 10px 20px 30px";
<!DOCTYPE html> Transform
<html>
<head>
<style>
#myDIV {
margin: auto;
border: 1px solid black;
width: 200px;
height:100px;
background-color: coral;
color: white;
}
</style>
</head>
<body>
<p>Click the "Try it" button to rotate the DIV element:</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
functionmyFunction() {
// Code for Chrome, Safari, Opera
document.getElementById("myDIV").style.WebkitTransform="rotate(20deg)";
// Code for IE9
document.getElementById("myDIV").style.msTransform="rotate(20deg)";
// Standard syntax
document.getElementById("myDIV").style.transform="rotate(20deg)";
}
</script>
</body>
</html>
<!DOCTYPE html>transitionTimingFunction
<html>
<head>
<style>
#myDIV {
border: 1px solid black;
background-color: lightblue;
width: 270px;
height:200px;
overflow:auto;
-webkit-transition:all 2s; /* For Safari 3.1 to 6.0 */
transition: all 2s;
}
#myDIV:hover {
background-color: coral;
width: 570px;
height:500px;
padding: 100px;
border-radius:50px;
}
</style>
</head>
<body>
<p>Mouse overthe DIV elementand it will change,gradually, both in color and size!</p>
<p>Click the "Try it" button and mouse over the DIV elementagain. The changes will now happen ina
linearspeedcurve.</p>
<button onclick="myFunction()">Tryit</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
functionmyFunction() {
document.getElementById("myDIV").style.WebkitTransitionTimingFunction="linear";// Code for
Safari 3.1 to 6.0
document.getElementById("myDIV").style.transitionTimingFunction ="linear"; // Standard
syntax
}
</script>
<p><strong>Note:</strong> The transitionTimingFunctionpropertyis supportedin InternetExplorer
10, Firefox,Opera,and Chrome.</p>
<p>Safari supports an alternative,the WebkitTransitionTimingFunctionproperty.</p>
</body>
</html>

More Related Content

DOCX
Borrador del blog
TXT
Private slideshow
PDF
Your Custom WordPress Admin Pages Suck
PPTX
計算機概論20161205
PPTX
計算機概論20161212
PDF
Java script programms
PDF
Make More Money With Advanced Custom Fields - WordCampYYC 2015
Borrador del blog
Private slideshow
Your Custom WordPress Admin Pages Suck
計算機概論20161205
計算機概論20161212
Java script programms
Make More Money With Advanced Custom Fields - WordCampYYC 2015

What's hot (20)

PDF
jQuery UI and Plugins
TXT
The project gutenberg e book, fairy tales from brazil, by elsie spicer
PDF
2013-06-25 - HTML5 & JavaScript Security
PDF
Laravel 로 배우는 서버사이드 #5
PDF
jQtouch, Building Awesome Webapps
ODP
Html5 101
PDF
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
PPTX
ChocolateChip-UI
PDF
Implement rich snippets in your webshop
PDF
Is HTML5 Ready? (workshop)
PDF
Why you should be using Web Components. And How - DevWeek 2015
PDF
Html5 101
PDF
ActiveResource & REST
PPT
jQuery For Beginners - jQuery Conference 2009
PDF
The Thinking behind BEM
PDF
Odoo - Create themes for website
PDF
Unlock the next era of UI design with Polymer
PPTX
Web Components Revolution
PDF
Web UI performance tuning
PDF
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
jQuery UI and Plugins
The project gutenberg e book, fairy tales from brazil, by elsie spicer
2013-06-25 - HTML5 & JavaScript Security
Laravel 로 배우는 서버사이드 #5
jQtouch, Building Awesome Webapps
Html5 101
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
ChocolateChip-UI
Implement rich snippets in your webshop
Is HTML5 Ready? (workshop)
Why you should be using Web Components. And How - DevWeek 2015
Html5 101
ActiveResource & REST
jQuery For Beginners - jQuery Conference 2009
The Thinking behind BEM
Odoo - Create themes for website
Unlock the next era of UI design with Polymer
Web Components Revolution
Web UI performance tuning
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
Ad

Viewers also liked (11)

PPTX
7 Ways to Embrace in Occupational Therapy Month
PPTX
Daily Assistance Devices
DOCX
Simon CV June 2015
DOCX
Sarah Roth CV August 2015
DOC
Ibrahim_Anwar_CV
PPTX
Matte areal 5.trinn
PPTX
Internet Of Things
PPTX
Vaccine ppt
DOCX
Skin icare
PPTX
Politici naţionalr şi internaţionale în privinţa protejării mediului
7 Ways to Embrace in Occupational Therapy Month
Daily Assistance Devices
Simon CV June 2015
Sarah Roth CV August 2015
Ibrahim_Anwar_CV
Matte areal 5.trinn
Internet Of Things
Vaccine ppt
Skin icare
Politici naţionalr şi internaţionale în privinţa protejării mediului
Ad

Similar to Javascript (20)

PDF
Javascript basic programs
PPTX
Css3 Complete Reference
PPTX
Less css
PPTX
uptu web technology unit 2 Css
DOC
Baitap tkw
PPT
Chapter 4 - Web Design
PPTX
css-backgrounds-210422075750.pvgfcvhbgvfcvbhnmbhvghnbmbhgfvhbnmptx
RTF
Java script frame window
 
PPTX
Css backgrounds
PPTX
HTML5 and CSS3 Techniques You Can Use Today
PDF
Responsive Email Design and Development
ODP
HTML5 Boilerplate - PV219
PPTX
Chapter 3 class power point
PPTX
Chapter 3 class power point
PPTX
Div Tag Tutorial
PDF
Using jQuery to Extend CSS
PDF
HTML 5 - Overview
Javascript basic programs
Css3 Complete Reference
Less css
uptu web technology unit 2 Css
Baitap tkw
Chapter 4 - Web Design
css-backgrounds-210422075750.pvgfcvhbgvfcvbhnmbhvghnbmbhgfvhbnmptx
Java script frame window
 
Css backgrounds
HTML5 and CSS3 Techniques You Can Use Today
Responsive Email Design and Development
HTML5 Boilerplate - PV219
Chapter 3 class power point
Chapter 3 class power point
Div Tag Tutorial
Using jQuery to Extend CSS
HTML 5 - Overview

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PDF
Computing-Curriculum for Schools in Ghana
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Lesson notes of climatology university.
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial disease of the cardiovascular and lymphatic systems
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
Computing-Curriculum for Schools in Ghana
FourierSeries-QuestionsWithAnswers(Part-A).pdf
TR - Agricultural Crops Production NC III.pdf
VCE English Exam - Section C Student Revision Booklet
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
RMMM.pdf make it easy to upload and study
Renaissance Architecture: A Journey from Faith to Humanism
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Lesson notes of climatology university.
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
01-Introduction-to-Information-Management.pdf
Cell Types and Its function , kingdom of life
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx

Javascript

  • 1. <!DOCTYPE html>background <html> <body> <h1>Hello World!</h1> <button onclick="myFunction()">Setbackground</button> <script> functionmyFunction() { document.body.style.background="#f3f3f3 url('img_tree.png') no-repeatrighttop"; } </script> </body> </html> <!DOCTYPE html>backgroundAttachment <html> <head> <style> body { background: #f3f3f3 url('img_tree.png') no-repeatrighttop; } </style> </head> <body> <h1>Hello World!</h1> <p><b>Tip:</b> Try to to resize the window ifthe scrollbar is not available.</p> <p><b>Tip:</b> Scroll the page before and after you have clickedthe button.</p> <button onclick="myFunction()">Setbackgroundimage to be fixed</button> <br> <script> functionmyFunction() { document.body.style.backgroundAttachment="fixed"; } </script> <p>Some text to enable scrolling.. <br><br><br><br> <br><br><br><br> </p> </body> </html>
  • 2. <!DOCTYPE html>backgroundColor <html> <body> <h1>Hello World!</h1> <button type="button" onclick="myFunction()">Setbackground color</button> <script> functionmyFunction() { document.body.style.backgroundColor="red"; } </script> </body> </html> <!DOCTYPE html>backgroundImage <html> <body> <h1>Hello World!</h1> <button type="button" onclick="myFunction()">Setbackgroundimage</button> <script> functionmyFunction() { document.body.style.backgroundColor="#f3f3f3"; document.body.style.backgroundImage ="url('img_tree.png')"; } </script> </body> </html> <!DOCTYPE html>backgroundPosition <html> <head> <style> body { background-image:url('img_tree.png'); background-repeat:no-repeat; } </style> </head> <body> <button type="button" onclick="myFunction()">Positionbackgroundimage</button>
  • 3. <script> functionmyFunction() { document.body.style.backgroundPosition="topright"; } </script> </body> </html> <!DOCTYPE html>backgroundRepeat <html> <head> <style> body { background: #f3f3f3 url('img_tree.png'); } </style> </head> <body> <h1>Hello World!</h1> <button type="button" onclick="myFunction()">Setbackground image to no-repeat</button> <script> functionmyFunction() { document.body.style.backgroundRepeat= "no-repeat"; } </script> </body> </html> <!DOCTYPE html>backgroundClip <html> <head> <style> #myDIV { width: 300px; height:300px; padding: 50px; background-color: coral; background-clip:border-box; color: white; border: 5px dotted lightgrey; } </style> </head> <body>
  • 4. <p>Click the "Try it" button to setthe background-clipproperty of the DIV elementto "content- box":</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> Lorem ipsumdolor sit amet, consectetueradipiscingelit,seddiam nonummynibh euismodtincidunt ut laoreetdolore magna aliquam erat volutpat. Ut wisi enimad minimveniam,quis nostrud exerci </div> <script> functionmyFunction() { document.getElementById("myDIV").style.backgroundClip="content-box"; } </script> </body> </html> <!DOCTYPE html>backgroundSize <html> <head> <style> #myDIV { border: 1px solid black; width: 300px; height:300px; background: url('smiley.gif') no-repeat; } </style> </head> <body> <p>Click the "Try it" button to enlarge the background-size of the DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> functionmyFunction() { document.getElementById("myDIV").style.backgroundSize ="60px120px"; } </script> </body> </html>
  • 5. <!DOCTYPE html>backfaceVisibility <html> <head> <style> div { width: 100px; height:100px; background: red; color: white; -webkit-animation:mymove 2s infinite linearalternate;/* Chrome,Safari, Opera */ animation: mymove 2s infinite linearalternate; } /* Chrome,Safari, Opera */ @-webkit-keyframesmymove { to {-webkit-transform:rotateY(180deg);} } @keyframesmymove { to {transform: rotateY(180deg);} } </style> </head> <body> <p>Check/uncheck the checkbox to change the backface-visibilityofthe animated DIV element:</p> <div id="myDIV"> <h1>Hello</h1> </div> <input type="checkbox" onclick="myFunction(this)" checked>backface-visibility <script> functionmyFunction(x) { if(x.checked=== true) { document.getElementById("myDIV").style.WebkitBackfaceVisibility="visible";//Code for Chrome, Safari, Opera document.getElementById("myDIV").style.backfaceVisibility="visible"; } else { document.getElementById("myDIV").style.WebkitBackfaceVisibility="hidden";// Code for Chrome,Safari, Opera document.getElementById("myDIV").style.backfaceVisibility="hidden"; } } </script> <p><strong>Note:</strong> The backface-visibilityandbackfaceVisibilitypropertiesare notsupported in InternetExplorer9 and earlierversions.</p>
  • 6. </body> </html> <!DOCTYPE html>border <html> <body> <div id="myDiv">Thisisa div element.</div> <br> <button type="button" onclick="myFunction()">Setborder</button> <script> functionmyFunction() { document.getElementById("myDiv").style.border="thicksolid #0000FF"; } </script> </body> </html> document.getElementById("myDiv").style.borderBottom="thicksolid#0000FF"; document.getElementById("myDiv").style.borderBottomColor="red"; <!DOCTYPE html>borderBottomLeftRadius <html> <head> <style> #myDIV { border: 1px solid black; width: 300px; height:300px; } </style> </head> <body> <p>Click the "Try it" button to change the border-bottom-left-radiuspropertyofthe DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> functionmyFunction() { document.getElementById("myDIV").style.borderBottomLeftRadius="25px"; document.getElementById("myDIV").style.borderBottomLeftRadius="25px";
  • 7. } </script> </body> </html> <!DOCTYPE html>borderBottomStyle <html> <body> <div id="myDiv">Thisisa div.</div> <br> <button type="button" onclick="myFunction()">Setsolidbottomborder</button> <script> functionmyFunction() { document.getElementById("myDiv").style.borderBottomStyle="solid"; } </script> </body> </html> <!DOCTYPE html>borderBottomWidth <html> <head> <style> #myDiv { border-style:solid; } </style> </head> <body> <div id="myDiv">Thisisa div element.</div> <br> <button type="button" onclick="myFunction()">Change widthofthe bottom border</button> <script> functionmyFunction() { document.getElementById("myDiv").style.borderBottomWidth="10px"; } </script> </body> </html>
  • 8. <!DOCTYPE html>borderCollapse <html> <body> <table id="myTable" border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$150</td> </tr> </table> <br> <button type="button" onclick="myFunction()">Collapseborder</button> <script> functionmyFunction() { document.getElementById("myTable").style.borderCollapse ="collapse"; } </script> </body> </html> <!DOCTYPE html>borderColor <html> <head> <style> #myDiv { border: thick solidblue; } </style> </head> <body> <div id="myDiv">Thisisa div.</div> <br> <button type="button" onclick="myFunction()">Change colorofthe four borders</button> <script> functionmyFunction() { document.getElementById("myDiv").style.borderColor="red"; } </script> </body> </html>
  • 9. <!DOCTYPE html>borderColor <html> <head> <style> #myDIV { border: 15px solidtransparent; width: 250px; padding: 10px 20px; -webkit-border-image:url(border.png) 3030 stretch; /* Safari 5 */ -o-border-image:url(border.png) 3030 stretch; /* Opera 12 */ border-image:url(border.png) 30 30 stretch; } </style> </head> <body> <p>Click the "Try it" button to change the border-image propertyof the DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> functionmyFunction() { document.getElementById("myDIV").style.WebkitBorderImage ="url(border.png) 30 30 round"; /* Code for Safari 5 */ document.getElementById("myDIV").style.OBorderImage ="url(border.png) 30 30 round"; /* Code for Opera 12 */ document.getElementById("myDIV").style.borderImage ="url(border.png) 3030 round"; } </script> </body> </html> <!DOCTYPE html>boxShadow <html> <head> <style> #myDIV { position:absolute; width: 100px; height:100px; background-color: coral; color: white; } </style> </head>
  • 10. <body> <p>Click the "Try it" button to setthe boxShadow property of the DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>myDIV</h1> </div> <script> functionmyFunction() { document.getElementById("myDIV").style.boxShadow="10px 20px 30px lightblue"; } </script> </body> </html> <!DOCTYPE html>display <html> <head> <style> #myDIV { width: 500px; height:500px; background-color: lightblue; } </style> </head> <body> <p>Click the "Try it" button to setthe displayproperty of the DIV elementto"none":</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> This is my DIV element. </div> <p><b>Note:</b> The elementwill nottake up any space whenthe displayproperty set to "none".</p> <script> functionmyFunction() { document.getElementById("myDIV").style.display="none"; } </script> </body> </html>
  • 11. <!DOCTYPE html>Style cursor Property <html> <body> <p id="myP">Mouse overthis textbefore and after you have clickedthe button below!</p> <button type="button" onclick="myFunction()">Change cursor</button> <script> functionmyFunction() { document.getElementById("myP").style.cursor= "pointer"; } </script> </body> </html> <!DOCTYPE html>font <html> <body> <p id="myP">Thisis a paragraph.</p> <button type="button" onclick="myFunction()">Setfont</button> <script> functionmyFunction() { document.getElementById("myP").style.font="italicbold 20px arial,serif"; } </script> </body> </html> document.getElementById("myP").style.fontFamily="Impact,Charcoal,sans-serif"; document.getElementById("myP").style.fontFamily="Impact,Charcoal,sans-serif"; document.getElementById("myP").style.fontSize ="xx-large"; document.getElementById("myP").style.fontStyle="italic"; document.getElementById("myP").style.fontVariant="small-caps"; document.getElementById("myBtn").style.height="50px"; document.getElementById("main".style.justifyContent="space-between"; document.getElementById("myBtn").style.left="100px"; document.getElementById("myP").style.letterSpacing="15px";
  • 12. document.getElementById("myDiv").style.lineHeight="3"; document.getElementById("myList").style.listStyle ="decimal inside"; document.getElementById("myList").style.listStyleImage="url('sqorange.gif')"; document.getElementById("myDiv").style.margin="50px 10px 20px 30px"; document.getElementById("myDiv").style.marginBottom="50px"; <!DOCTYPE html>overflow <html> <head> <style> #myDIV { border: 1px solid black; background-color: lightblue; width: 300px; height:210px; overflow:visible; } </style> </head> <body> <p>Click the "Try it" button to change the overflowproperty ofthe DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> Lorem ipsumdolor sit amet, consectetueradipiscingelit,seddiam nonummynibh euismodtincidunt ut laoreetdolore magna aliquam erat volutpat. Ut wisi enimad minimveniam,quis nostrud exerci type extra </div> <script> functionmyFunction() { document.getElementById("myDIV").style.overflow="scroll"; } </script> </body> </html> document.getElementById("myDIV").style.overflowX="scroll"; document.getElementById("myDIV").style.overflowX="scroll"; document.getElementById("myDiv").style.padding="50px 10px 20px 30px"; <!DOCTYPE html> Transform <html> <head> <style> #myDIV { margin: auto; border: 1px solid black;
  • 13. width: 200px; height:100px; background-color: coral; color: white; } </style> </head> <body> <p>Click the "Try it" button to rotate the DIV element:</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>myDIV</h1> </div> <script> functionmyFunction() { // Code for Chrome, Safari, Opera document.getElementById("myDIV").style.WebkitTransform="rotate(20deg)"; // Code for IE9 document.getElementById("myDIV").style.msTransform="rotate(20deg)"; // Standard syntax document.getElementById("myDIV").style.transform="rotate(20deg)"; } </script> </body> </html> <!DOCTYPE html>transitionTimingFunction <html> <head> <style> #myDIV { border: 1px solid black; background-color: lightblue; width: 270px; height:200px; overflow:auto; -webkit-transition:all 2s; /* For Safari 3.1 to 6.0 */ transition: all 2s; } #myDIV:hover { background-color: coral; width: 570px; height:500px; padding: 100px;
  • 14. border-radius:50px; } </style> </head> <body> <p>Mouse overthe DIV elementand it will change,gradually, both in color and size!</p> <p>Click the "Try it" button and mouse over the DIV elementagain. The changes will now happen ina linearspeedcurve.</p> <button onclick="myFunction()">Tryit</button> <div id="myDIV"> <h1>myDIV</h1> </div> <script> functionmyFunction() { document.getElementById("myDIV").style.WebkitTransitionTimingFunction="linear";// Code for Safari 3.1 to 6.0 document.getElementById("myDIV").style.transitionTimingFunction ="linear"; // Standard syntax } </script> <p><strong>Note:</strong> The transitionTimingFunctionpropertyis supportedin InternetExplorer 10, Firefox,Opera,and Chrome.</p> <p>Safari supports an alternative,the WebkitTransitionTimingFunctionproperty.</p> </body> </html>