htmlcss案例代码(htmlcss,请问怎么敲代码,使每行只放三个图片呢一共六张图)

本文目录
htmlcss,请问怎么敲代码,使每行只放三个图片呢一共六张图
这里提供两种方法:
1.每3个就在后面加上《br》《br》,注意是两个br这样就换行了。
2.用css来实现,控制.goods的宽度。
一般为33%,不知道你的.goods类是怎么写的,如果有margin的话就要比33%小一点。
具体代码:
《style》
* {
margin: 0;
padding: 0;
}
.goods {
border: 1px solid #ccc;
height: 100px;
width: 33.333%;
float: left;
box-sizing:border-box;
padding:10px;
}
《/style》
《div class="goods"》1《/div》
《div class="goods"》2《/div》
《div class="goods"》3《/div》
《div class="goods"》4《/div》
《div class="goods"》5《/div》
《div class="goods"》6《/div》
用html加css做一个心脏跳动的页面的代码
《!DOCTYPE html》
《html》
《head》
《meta charset="UTF-8"》
《title》HTML5爱心跳动动画DEMO演示《/title》
《style》
***隐藏网址***
***隐藏网址***
body {
background-color: #ccc;
}
.container {
width: 512px;
height: 380px;
margin: auto;
margin-top: 0;
}
.heart {
z-index: 1;
width: 150px;
height: 150px;
position: absolute;
top: 50%;
margin-top: -75px;
left: 50%;
margin-left: -75px;
background-size: 100%;
background-repeat: no-repeat;
background-image:url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjE3M3B4IiBoZWlnaHQ9IjE1OHB4IiB2aWV3Qm94PSIwIDAgMTczIDE1OCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTczIDE1OCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBmaWxsPSIjRUY0NjU3IiBkPSJNMTU3LjMzMSwxNS41MDRjLTE5LjU1OS0xOS41NTktNTEuMjcxLTE5LjU1OS03MC44MzEsMGMtMTkuNTU5LTE5LjU1OS01MS4yNzEtMTkuNTU5LTcwLjgzMSwwDQoJYy0xOS41NTksMTkuNTU5LTE5LjU1OSw1MS4yNzEsMCw3MC44MzFsNzAuODMxLDcwLjgzbDcwLjgzMS03MC44M0MxNzYuODksNjYuNzc1LDE3Ni44OSwzNS4wNjQsMTU3LjMzMSwxNS41MDR6Ii8+DQo8L3N2Zz4=");
}
.hometown {
font-family:’Inconsolata’, sans-serif;
font-weight: bold;
font-size: 2.0em;
text-transform: uppercase;
position: relative;
z-index: 1;
width: 512px;
height: 512px;
color: #FFF;
}
#top {
width: 200px;
margin: auto;
position: relative;
}
#top span {
height: 350px;
position: absolute;
width: 20px;
left: 50%;
margin-left: -10px;
top: 110px;
}
.char1 {
transform: rotate(-36deg);
}
.char2 {
transform: rotate(-24deg);
}
.char3 {
transform: rotate(-12deg);
}
.char4 {
transform: rotate(0deg);
}
.char5 {
transform: rotate(12deg);
}
.char6 {
transform: rotate(24deg);
}
.char7 {
transform: rotate(36deg);
}
#bottom span {
height: 350px;
line-height: 700px;
position: absolute;
width: 20px;
left: 50%;
margin-left: -10px;
top: 10px;
}
#bottom .char1 {
transform: rotate(36deg);
}
#bottom .char2 {
transform: rotate(27deg);
}
#bottom .char3 {
transform: rotate(18deg);
}
#bottom .char4 {
transform: rotate(9deg);
}
#bottom .char5 {
transform: rotate(0deg);
}
#bottom .char6 {
transform: rotate(-9deg);
}
#bottom .char7 {
transform: rotate(-18deg);
}
#bottom .char8 {
transform: rotate(-27deg);
}
#bottom .char9 {
transform: rotate(-36deg);
}
.city {
font-family:"Hammersmith One";
display: inline-block;
width: 100%;
height: 300px;
padding-top: 45px;
text-align: center;
font-size: 3.0em;
z-index: 100;
position: absolute;
top: 50%;
margin-top: -110px;
}
.heart {
animation: HEARTBEAT 2.5s infinite;
}
#top span {
animation: BOUNCE 2.5s infinite;
}
@keyframes HEARTBEAT {
0% {
transform: scale(1);
}
5% {
transform: scale(1.3);
}
10% {
transform: scale(1.1);
}
15% {
transform: scale(1.5);
}
50% {
transform: scale(1);
}
100% {
transform: scale(1);
}
}
@keyframes BOUNCE {
0% {
top: 110px;
}
10% {
top: 80px;
}
15% {
top: 85px;
}
20% {
top: 70px;
}
75% {
top: 110px;
}
100% {
top: 110px;
}
}
《/style》
《script src="js/prefixfree.min.js"》《/script》
《/head》
《body》
《div class="container bg"》
《div class="hometown"》
《div class="heart"》
《/div》
《div id="top"》Made in《/div》
《div class="city"》Boise《/div》
《div id="bottom"》With love《/div》
《/div》
《/div》
《div style="text-align:center;clear:both"》
《script src="/gg_bd_ad_720x90.js" type="text/javascript"》《/script》
《script src="/follow.js" type="text/javascript"》《/script》
《/div》
《script src=’js/jquery.js’》《/script》
《script src=’js/jquery.lettering.js’》《/script》
《script src="js/index.js"》《/script》
《/body》
《/html》
js部分

更多文章:
简易w3school教程网页面代码(想记一下网页制作的常用代码,不知道有哪些)
2025年12月2日 14:45
正则表达式匹配换行符和空格(为什么这个正则表达式不能匹配空格和换行)
2026年4月22日 13:30
js图片无缝滚动的原理(请问一下滚动的原理是什么,我有点晕乎乎的谁能给我解释详细一点感激不尽)
2026年4月24日 09:00
notnull参数的作用(SpringMVC注解中的这个@Resource和@Notnull各有什么用处啊能讲详细点么)
2026年1月12日 23:15
插入语句命令(VF中如果要在第3条记录之前插入新的记录,应怎样编写insert语句)
2026年8月24日 18:15
memcached性能(PHP中4个加速,缓存扩展的区别和选用建议)
2025年9月8日 08:45
national geographic(national geographic什么意思)
2026年1月16日 18:15
















