分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

HTML+CSS页面练习——legend第四部分

发布时间:2023-09-06 01:13责任编辑:郭大石关键词:CSSHTML

第四部分——Portfolio

简要介绍:

本部分内容看着比较多,其实它的许多地方是一样的。所以只需要设置好一个类的样式,就可以运用到它们所有的上面。

页面效果:

(两张图片之间没有空隙)

HTML代码:

<section id="portfolio"> ???????<div class="container"> ???????????<div class="align"><i class="icon-desktop-circled"> </i></div> ???????????<h1>Portfolio...</h1> ???????????<div class="row"> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-01.jpg"><img src="img/portfolio-01.jpg" alt=" " /></a> ???????????????????????</div> ???????????????????</div> ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>Ethan Marcotte Design</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????</div> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-02.jpg"><img src="img/portfolio-02.jpg" alt=" "/></a> ???????????????????????</div> ???????????????????</div > ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>A Book Apart</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????</div> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-03.jpg"><img src="img/portfolio-03.jpg" alt=" " /></a> ???????????????????????</div> ???????????????????</div> ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>Four Rules for Designers</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????????????????????????</div> ???????????</div> ???????????<div class="row"> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-01.jpg"><img src="img/portfolio-01.jpg" alt=" " /></a> ???????????????????????</div> ???????????????????</div> ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>Ethan Marcotte Design</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????</div> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-02.jpg"><img src="img/portfolio-02.jpg" alt=" "/></a> ???????????????????????</div> ???????????????????</div > ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>A Book Apart</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????</div> ???????????????<div class="span4"> ???????????????????<div class="mask2"> ???????????????????????<div> ???????????????????????????<a href="img/portfolio-03.jpg"><img src="img/portfolio-03.jpg" alt=" " /></a> ???????????????????????</div> ???????????????????</div> ???????????????????<div class="inside"> ???????????????????????<hgroup><h2>Four Rules for Designers</h2></hgroup> ???????????????????????<div class="entry-content"> ???????????????????????????<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry‘s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> ???????????????????????????<a class="more-link" href="#">view project</a> ???????????????????????</div> ???????????????????</div> ???????????????</div> ???????????</div> ???????</div> ???</section>

CSS代码:

 ??????#portfolio{ ???????????margin-top: 20px; ???????????padding: 70px; ???????} ???????#portfolio .row{ ???????????text-align: center; ???????} ???????#portfolio .align{ ???????????text-align:center; ???????????font-size: 6em; ???????????margin: 10px 0 0 0; ???????????padding: 0; ???????} ???????#portfolio h1{ ???????????text-align: center; ???????????font-size: 3em; ???????????font-family: ‘Patua One‘,cursive; ???????????margin: 0.4em 0 1em 0; ???????} ???????#portfolio h2{ ???????????text-align: left; ???????????margin-top: 1em; ???????????font-weight: bold; ???????????font-family: ‘Patua One‘,cursive; ???????????text-transform: capitalize; ????????????????/*控制文本大小写,capitalize表示文本中每个单词以大写字母开头*/ ???????} ???????.mask2 img{ ???????????margin: 0 auto; ???????????max-width: 100%; ???????????display: block; ???????????filter: alpha(opacity=80); ???????????????/*滤镜属性,定义元素的可视效果。设置元素的透明度为0.8*/ ???????????opacity: 0.8; ???????????box-shadow: 1px 1px 10px rgba(0,0,0,0.2); ???????????transition: all 0.3s ease-in-out; ???/*渐变属性*/ ???????} ???????.mask2 img:hover{ ???????????filter: alpha(opacity=99); ???????????opacity: 1; ??????????/*不透明*/ ???????} ???????#portfolio .entry-content{ ???????????margin: 1em 0 2.5em; ???????} ???????#portfolio .span4{ ???????????display: inline-block; /*元素为行内块元素*/ ???????????width: 32%; ???????} ???????#portfolio p{ ???????????text-align: left; ??????/*左对齐*/ ???????????line-height: 25px; ???????} ???????#portfolio .more-link{ ???????????float: left; ???????????text-decoration: none; ???????????text-transform: uppercase; ???????????/*控制文本大小写,uppercase表示文本中每个单词都是大写字母*/ ???????????font-family: ‘Open Sans‘,serif; ???????????font-weight: bold; ???????????font-size: 0.9em; ???????????color:#f0bf00; ???????????margin: 12px 0 40px 0; ???????} ???????#portfolio .more-link:hover{ ???????????text-decoration: underline ; ???????}

总结:

本部分没有什么难点,就是调整样式比较繁琐。

HTML+CSS页面练习——legend第四部分

原文地址:http://www.cnblogs.com/209yin/p/7594592.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved