用HTML5+CSS3做一个好看的界面

效果图:

鼠标经过图像的时候会触发hover 1s内转一圈=-=

代码:

<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <title>MyHtml.html</title>

    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=gb2312">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<style type="text/css">
*{ margin:0;padding=0;}
body{background: url("../images/辉夜.jpeg") scroll;}
li {list-style: none;}
#box{
width: 1070px;
height: 630px;
margin: 50px auto;
}
#box ul li{
position:relative;
float: left;
width: 180px;
height: 105px;
background: rgba(0,0,0,0.5);
margin:30px 5px;
color:black;
}
#box ul li.six{
margin-left:100px;
}
#box ul li div{
position:absolute;
top:0;
left:0;
width:180px;
height: 105px;
background: black;
}
#box ul li:before,#box ul li:after{
content:"";
position:absolute;
top:0;
left:0;
width:180px;
height: 105px;
background: rgba(0,0,0,0.5);;
}
#box ul li:before{
transform:rotate(60deg);
}
#box ul li:after{
transform:rotate(-60deg);
}
#box ul li img{
position: absolute;/*定位*/
z-index:2;/*层级关系 配套定位使用*/
transition:all 1s;
margin: 0 40px;
}


#box ul li:hover img{
transform:scale(1.4) rotate(360deg);
}
</style>
  </head>
  
  <body>
<div id="box">
<ul>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li class="six">
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
<li>
<img alt="1" src="../images/luoma.jpg"width="100" height="100">
</li>
</ul>
</div>
  </body>
</html>

  • 4
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
好的,以下是一个简单的带有验证码的登录页面示例,使用了HTMLCSS: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Login Page</title> <style> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } .container { width: 400px; margin: 0 auto; background-color: #fff; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); padding: 20px; box-sizing: border-box; margin-top: 50px; } h2 { text-align: center; margin-top: 0; } label { display: block; margin-bottom: 5px; font-weight: bold; color: #333; } input[type=text], input[type=password], input[type=submit] { width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box; } input[type=submit] { background-color: #4CAF50; color: #fff; border: none; cursor: pointer; } .captcha { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; } .captcha-label { flex: 1; } .captcha-img { flex: 1; margin-left: 20px; } .captcha-img img { width: 100%; border: 1px solid #ccc; border-radius: 3px; } @media screen and (max-width: 480px) { .container { width: 90%; } } </style> </head> <body> <div class="container"> <h2>Login Page</h2> <form action="#" method="post"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> <label for="password">Password:</label> <input type="password" id="password" name="password" required> <div class="captcha"> <label class="captcha-label" for="captcha">Captcha:</label> <div class="captcha-img"> <img src="generate_captcha.php" alt="Captcha Image"> </div> </div> <input type="text" id="captcha" name="captcha" required> <input type="submit" value="Login"> </form> </div> </body> </html> ``` 在上面的示例中,我们使用了一个简单的表单来实现登录功能。其中,用户名和密码的输入框都添加了`required`属性,表示这两个字段是必填项。 同时,我们还添加了一个验证码输入框和一个验证码图片。验证码图片的URL指向`generate_captcha.php`,这是一个动态生成验证码图片的PHP脚本。当用户提交表单时,后端会通过验证输入的验证码是否和生成的一致,以确保用户是一个真实的人而不是机器人。 你可以通过以下CSS代码实现样式: - `container`类定义了整个登录页面的样式,包括背景色、宽度、边框、内边距等。 - `h2`标签定义了标题的样式,使其居中显示并去掉默认的上边距。 - `label`标签定义了输入框前的标签的样式,包括加粗、颜色等。 - `input[type=text]`、`input[type=password]`和`input[type=submit]`定义了输入框和提交按钮的样式,包括宽度、内边距、边框、圆角等。 - `captcha`类定义了验证码输入框和验证码图片的样式,使用flex布局,让它们水平排列,并设置间距等。 - `captcha-label`类定义了验证码输入框前的标签的样式,使用flex布局,让它们占据相同的宽度。 - `captcha-img`类定义了验证码图片的样式,使用flex布局,让它占据剩余的宽度,并设置了左边距。 - `captcha-img img`定义了验证码图片的样式,设置了宽度、边框、圆角等。 希望以上内容能够帮助到你。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值