JavaScript 是脚本语言
JavaScript 是一种轻量级的编程语言。
JavaScript 是可插入 HTML 页面的编程代码。
JavaScript 插入 HTML 页面后,可由所有的现代浏览器执行。
JavaScript 很容易学习。
JavaScript:写入 HTML 输出
实例:
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph</p>");
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HelloWorld</title>
<script type="text/javascript"
alert(" hello world");
document.write("看我出不出来~~~");
console.log("你猜我在哪出来呢?");
</script>
</head>
<body>
</body>
</html>
效果
image.png
image.png
作业
image.png
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>POLO360</title>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/css.css">
</head>
<body>
<div class="head">
<div class="title">
<div class="box-img">
<img src="img/logo.png">
</div>
<ul class="title-ul">
<li>
<a href="javascript:;">HOME</a>
<p>Back to home</p>
</li>
<li>
<a href="javascript:;">PRODUCTS</a>
<p>What we have for you</p>
</li>
<li>
<a href="javascript:;">SERVICES</a>
<p>Things we do</p>
</li>
<li>
<a href="javascript:;">BLOG</a>
<p>Follow our updates</p>
</li>
<li>
<a href="javascript:;">CONTACT</a>
<p>Ways to reach us</p>
</li>
</ul>
</div>
<div class="main">
<ul>
<li>
<a href="">
<img class="s" src="img/pointer.png">
<img class="h" src="img/pointer.active.png">
</a>
</li>
<li>
<a href="">
<img class="s" src="img/pointer.png">
<img class="h" src="img/pointer.active.png">
</a>
</li>
<li>
<a href="">
<img class="s" src="img/pointer.png">
<img class="h" src="img/pointer.active.png">
</a>
</li>
<li>
<a href="">
<img class="s" src="img/pointer.png">
<img class="h" src="img/pointer.active.png">
</a>
</li>
<li>
<a href="">
<img class="s" src="img/pointer.png">
<img class="h" src="img/pointer.active.png">
</a>
</li>
</ul>
<img src="img/banner=pg.png" alt="阴影">
</div>
</div>
<div class="content w clearfix">
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit</h1>
<!-- h1下边设置三个小标题块 -->
<div class="pl">
<h2>Perfect Logic</h2>
<p class="p1">All you want your website to do</p>
<div class="imgDiv">
<img src="img/pic/pic1.jpg" alt="男孩">
</div>
<p class="p2">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.1</p>
<a href="#" class="lm">Learn More</a>
</div>
<div class="cs">
<h2>Complete Solution</h2>
<p class="p1">A tool anything and everything you can think</p>
<div class="imgDiv">
<img src="img/pic/pic2.jpg" alt="女孩">
</div>
<p class="p2">Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciun tdolore magnam aliquam quaerat voluptatem.</p>
<a href="#" class="lm">Learn More</a>
</div>
<div class="uc">
<h2>Uber Culture</h2>
<p class="p1">Fresh. Modern and ready for future</p>
<div class="imgDiv">
<img src="img/pic/pic3.jpg" alt="球">
</div>
<p class="p2">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
<a href="#" class="lm">Learn More</a>
</div>
</div>
<div class="contact w clearfix">
<div class="sc">
<h2>Social Connection</h2>
<p class="p1">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium</p>
<div class="icon">
<a href="#"><img src="img/logo1.png" alt="图1"></a>
<a href="#"><img src="img/logo2.png" alt="图2"></a>
<a href="#"><img src="img/logo3.png" alt="图3"></a>
<a href="#"><img src="img/logo4.png" alt="图4"></a>
<a href="#"><img src="img/logo5.png" alt="图5"></a>
</div>
<h2 class="nl">Newsletter</h2>
<p class="p1">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium</p>
<form action="#">
<input class="txt" type="text" placeholder="your email address">
<button class="btn">Subscribe</button>
</form>
</div>
<div class="co">
<h2>Contact</h2>
<form action="#">
<input class="txt" type="text" placeholder="your name">
<input class="txt" type="text" placeholder="your email">
<textarea class="tarea" placeholder="message "></textarea>
<button class="btn">Send it</button>
</form>
</div>
<div class="nu">
<h2>News Updates</h2>
<p>
<img src="img/pic/new1.png" alt="new1">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
<p>
<img src="img/pic/new2.png" alt="new2">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.
</p>
<p class="no">
<img src="img/pic/new3.png" alt="new3">
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium.
</p>
<button class="btn">Visit our Blog</button>
</div>
</div>
<div class="footer">
<div class="w">
<p class="copy">Copyright 2010. Studio VIVROCKS. All Rights Reserved.</p>
<p>Site Powered by Wordpress. Design and Developed by VIVROCKS.</p>
<p>
<a href="#">Home</a> | <a href="#">About</a> |<a href="#">Products</a> | <a href="#">Services</a> | <a href="#">Contact</a>
</p>
<p>
<a href="#">Privacy Policy</a> | <a href="#">Terms of use</a>
</p>
</div>
</div>
</body>
</html>
网友评论