CSS/HTML制作电影网站中的电影卡片

37 篇文章 8 订阅

简介:
本案例宽度固、底部评分栏宽高固定,总体高度可根据文量和图片的大小自动调整
效果图(通过不同文字和图片呈现效果):
在这里插入图片描述
在这里插入图片描述
源码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电影卡片</title>
    <link rel="stylesheet" href="../02CSS/reset.css">
    <link rel="stylesheet" href="./icon/电影卡片/iconfont.css">
    <style>
        /* 主体 */
        .auter{
            color: #B2B0B0;
            width: 240px;
            margin: 50px;
            box-shadow: 0px 0px 10px;
            position: relative;
        }
        /* 图片 */
        .picture{
            width: 240px;
            height: auto;
            position: relative;
        }
        /* 电影名称 */
        .name{
            font-size: 19px;
            margin: 15px 20px 10px 20px;
            width: auto;
            color: #717171;
        }
        /* 电影类型前的图标 */
        .type::before{
            content: '\e624';
            font-family: iconfont;
        }
        /* 电影类型 */
        .type{
            margin: 10px 20px 15px 20px;
            width: auto; 
        }
        /* 电影介绍 */
        .introduce{
            margin: 20px 20px 15px 20px;
            width: auto;
            line-height: 20px;
        }


        /* 底栏 */
        .bottombar{
            width: auto;
            height: 48px;
            border-top: 1px #dddddd solid;
        }
        /* 前两个绿色星星 */
        .star1{
            display: inline-block;
            line-height: 48px;
            font-size: 22px;
            margin: 0px auto 0px 18px;
            color: #B9CB41;
        }
        /* 后两个灰色星星 */
        .star2{
            display: inline-block;
            line-height: 48px;
            font-size: 22px;
            width: auto;
            color: #D6D6D6;
        }
        /* Facebook图标 */
        .facebook{
            display: inline-block;
            line-height: 48px;
            font-size: 22px;
            margin-left: 80px;
            color: #D6D6D6;
        }
    </style>
</head>
<body>
    <div class="auter">
        <div class="picture">
            <img src="./img/10/2.jpg" alt="">
        </div>
        <h1 class="name">冰雪奇缘</h1>
        <h2 class="type"> 3D电影</h2>
        <p class="introduce">这是一步非常好看的电影,好看的不得了来来来范德萨发发送到发了lorem</p>
        <div class="bottombar">
            <span class="star1 iconfont">&#xe66f;&#xe66f;</span><span class="star2 iconfont">&#xe66f;&#xe66f;</span>
            <span class="facebook iconfont">&#xeb8d;</span>
        </div>
    </div>

</body>
</html>
  • 6
    点赞
  • 52
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
以下是一个简单的HTMLCSS代码,用于制作一个网页版贺卡: ``` <!DOCTYPE html> <html> <head> <title>网页版贺卡</title> <style> body { background-color: #f9f9f9; font-family: Arial, sans-serif; text-align: center; } h1 { color: #ff0000; font-size: 36px; margin-top: 50px; } p { font-size: 24px; margin-top: 20px; } .card { background-color: #ffffff; border: 2px solid #dddddd; border-radius: 10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); margin: 50px auto; padding: 30px; width: 500px; } .image { max-width: 100%; margin-bottom: 20px; } .button { background-color: #ff0000; border: none; border-radius: 5px; color: #ffffff; cursor: pointer; font-size: 18px; margin-top: 20px; padding: 10px 20px; text-align: center; text-decoration: none; transition: background-color 0.3s ease; } .button:hover { background-color: #cc0000; } </style> </head> <body> <div class="card"> <img class="image" src="https://via.placeholder.com/400x200" alt="贺卡图片"> <h1>祝你新年快乐!</h1> <p>愿新的一年里,你健康快乐,事业有成,家庭幸福!</p> <a class="button" href="#">发送贺卡</a> </div> </body> </html> ``` 在这个代码,我们使用了HTML标签来创建页面内容,CSS来控制样式。首先,我们设置了页面的背景颜色和字体。然后,我们使用一个包含图片、标题、段落和按钮的卡片容器。最后,我们使用CSS来添加样式,如背景颜色、边框、阴影、圆角、字体大小和按钮样式。通过调整这些样式,您可以创建自己的独特贺卡。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值