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

第四部分——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 ;
        }

总结:

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

时间: 2024-10-07 07:31:09

HTML+CSS页面练习——legend第四部分的相关文章

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

第二部分--headerwrap 简要介绍: 本部分有两个标题<h1><h2>,两个<input>元素,还有无序列表<ul>和链接<a>实现的5个链接. 页面效果: HTML代码: <div id="headerwrap"> <header class="clearfix"> <h1><span>Legend! </span>We make web

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

第一部分navbar-wrapper 简要介绍: 本部分为导航部分,会固定在浏览器页面的顶部,不会随文档的滚动而移动.运用无序列表中放入链接(<ul><li><a></a></li></ul>)的方式来实现导航.当鼠标放在该元素上面时,其样式会发生变化. 页面效果: 字体的引入: <link href='http://fonts.googleapis.com/css?family=Quattrocento:400,700'  r

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

第三部分--feature 简要介绍: 这部分比较简单.主要用<p>元素写了两句话.用一张图片设置背景. 页面效果: HTML代码: <div > <section id="feature"> <article> <p>We work to make web a beautiful place.</p> <p>We craft beautiful designs and convert them int

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

第五部分--Service 简要介绍: 页面效果: HTML代码: <section id="services"> <div class="container"> <div class="align"><i class="icon-cog-circled"></i></div> <h1>Services</h1> <div c

使用CSS隐藏HTML元素的四种常用方法

CSS隐藏HTML元素的四种常用方法 1.opacity:设置opacity: 0可以使一个元素变得完全透明. 设置的透明度会被子元素继承,而且无法取消. 通常可以使用opacity属性来制作元素的淡入淡出效果. 设置opacity:1可以使透明元素变得可见. 2.visibility: 是许多人在隐藏某个HTML元素时的首选. visibility:hidden视觉上看不见,但它所占据空间的位置仍然存在. 3.display:none它是position:absolute和visibility

优化页面访问速度(四) ——前端优化

优化页面访问速度(四) ——前端优化 一.概述 前端的优化,主要可以通过减少HTTP请求.非实时请求改异步.缓存.文件压缩.CDN加速.独立图片服务器等. 二.减少HTTP请求 1.HTTP开销 HTTP请求,需要耗费资源,主要包括域名解析.建立TCP连接.发送请求.等待处理结果.下载资源.解析请求等. 因此,减少HTTP请求,利于优化页面访问速度. 2.图片地图 对于多个图片,如连续的几个按钮,每个按钮都是一个小图片.如果逐个加载图片,则需要发送多个请求,分别获取这些图片文件. 这里,可以将这

css基础css页面布局基础

样式可以在HTML中定义,也可以在一个单独的外部样式文件中定义.样式可以分为嵌入式样式表,外部样式表,内联样式表. 外部样式表:首先要建一个后缀为.css的样式表文件,然后在web文档中的<head>段使用<link>标记,这样就可以将一个外部样式表文件链接到文档中. 语法:<link rel="stylesheet" type="text/css" href="样式表的url"/> 嵌入式样式表:在web文档

div+css页面布局-html代码

<html> <head> <title>div+css页面布局</title> <meta http-equiv="content-type" content="text/html" > <link rel="stylesheet" type="text/css" href="css/layout.css" /> </head&

CSS页面模块的常用命名

CSS页面模块的常用命名:        头:header        内容:content/container        尾:footer        导航:nav        侧栏:sidebar        栏目:column        页面外围控制整体布局宽度:wrapper        左右中:left right center        登录条:loginbar        标志:logo        广告:banner        页面主体:main