HTML+CSS+JavaScript网页制作案例教程-黑马程序员-第五章课后习题(课程介绍专栏效果)

黑马程序员编著的教材  HTML+CSS+JavaScript网页制作案例教程

第五章:“课程介绍”专栏-课后习题参考代码

题目原型:

请结合给出的素材,运用列表标记,超链接标记以及css控制列表与超链接的样式实现如下图的效果。

。。。。。。。。

记得 关注,收藏,评论哦,作者将持续更新。。。。

我自己做的效果如下:

 

参考代码如下;

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>课程介绍专栏</title>
<style type="text/css">
*{margin:0; padding:0; list-style:none; outline:none;}
body{font-family:"微软雅黑"; font-size:14px;}
a:link,a:visited{color:#f4f4e1;text-decoration:none;}
a:hover{color:#ce4d52;}
.bg{width:461px; height:532px; background:#ce4d52; margin:10px auto;}
h2{width:461px; height:95px; background:url(images/head.png) no-repeat; border-bottom:1px solid #8d2327;}
ul{width:461px; border-top:1px solid #e68589;}
a{display:inline-block; width:451px; height:103px; background:url(images/bg.png) no-repeat; padding:42px 0 0 10px;}
a span{display:inline-block; width:110px; height:60px; text-align:right;}
a .num,a .descript{ vertical-align:middle; width:90px;}
a .descript{text-align:left; padding-left:35px;}
a:hover{background:url(images/bg1.png) no-repeat;}
a:hover .num{color:#f4f4e1;}
</style>
</head>
<body>
<div class="bg">
	<h2></h2>
    <ul>
    	<li>
        	<a href="#">
                <span>印刷流程<br />广告设计<br />企业形象设计</span>
                <span class="num">1</span>
                <span class="descript">平面设计</span>
            </a>
        </li>
        <li>
        	<a href="#">
                <span>页面设计<br />HTML+CSS<br />JS和JQ交互特效</span>
                <span class="num">2</span>
                <span class="descript">网页设计</span>
            </a>
        </li>
        <li>
        	<a href="#">
                <span>视觉创意设计<br />人机交互原则<br />UI设计规范</span>
                <span class="num">3</span>
                <span class="descript">UI设计</span>
            </a>
        </li>
    </ul>
</div>
</body>
</html>

 需要的图片如下:

 

记得把图片放到images文件夹里边,否则会找不到。

  • 11
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
以下是一个简单的商品专栏网页制作代码示例: ```html <!DOCTYPE html> <html> <head> <title>商品专栏</title> <style type="text/css"> body { font-family: Arial, sans-serif; background-color: #f2f2f2; } h1 { text-align: center; margin-top: 50px; color: #333; } .container { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 50px; } .item { width: 300px; margin: 20px; padding: 20px; border: 1px solid #ccc; background-color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: box-shadow 0.3s ease; } .item:hover { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); } .item img { display: block; margin: 0 auto; max-width: 100%; height: auto; } .item h2 { margin-top: 20px; color: #333; font-size: 24px; text-align: center; } .item p { margin-top: 10px; font-size: 16px; line-height: 1.5; text-align: justify; } .item .price { margin-top: 20px; text-align: center; color: #f00; font-size: 24px; font-weight: bold; } </style> </head> <body> <h1>商品专栏</h1> <div class="container"> <div class="item"> <img src="item1.jpg" alt="商品1"> <h2>商品1名称</h2> <p>商品1描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p> <div class="price">¥99.99</div> </div> <div class="item"> <img src="item2.jpg" alt="商品2"> <h2>商品2名称</h2> <p>商品2描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p> <div class="price">¥199.99</div> </div> <div class="item"> <img src="item3.jpg" alt="商品3"> <h2>商品3名称</h2> <p>商品3描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p> <div class="price">¥299.99</div> </div> </div> </body> </html> ``` 你可以在 `img` 标签中替换相应的图片路径,修改商品名称、描述和价格等内容。同时,你也可以添加更多的商品信息来完善你的商品专栏页面。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xiaozhima-dun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值