css 基本的客户端javascript示例,具有响应式布局
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 基本的客户端javascript示例,具有响应式布局相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gallery</title>
<link rel="stylesheet" href="stylesheets/gallery.css">
</head>
<body>
<div class="container">
<div class="box a">
<h2>Image Gallery</h2>
</div>
<div class="box b photos">
<img id="lead-photo" src="images/Stretched_Dachshund.jpg" align="middle">
</div>
<div class="box c">
<h2>Next Image</h2>
<button>Go!</button>
<div></div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="javascripts/gallery.js"></script>
</body>
</html>
body {
margin: 40px;
}
.container {
display: grid;
grid-gap: 5px;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
grid-template-rows: auto auto;
background-color: #fff;
color: #444;
}
.box {
background-color: #444;
color: #fff;
border-radius: 5px;
padding: 20px;
font-size: 150%;
}
.a {
grid-column: 1 / span 3;
text-align: center;
}
.b {
grid-column: 1 / span 2;
grid-row: 2;
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
grid-template-rows: repeat(2, 100px);
}
.c {
grid-row: 2;
text-align: center;
}
button {
font: bold 24px Arial;
background-color: black;
color: lime;
padding: 2px 6px 2px 6px;
border-radius: 10px;
border: 1px solid #CCCCCC;
}
#lead-photo {
width: 300px;
margin: auto;
padding: 1em;
border-radius: 50px;
}
以上是关于css 基本的客户端javascript示例,具有响应式布局的主要内容,如果未能解决你的问题,请参考以下文章
基于JavaScript的DDoS的攻防介绍
Hybrid App开发之JavaScript基础
JavaScript基础知识
javascript mouseover 未注册,但 CSS 是
html+css+javascript实现列表循环滚动示例代码
Javascript - 将 css 样式添加到具有类的元素