CSS3+CSS+HTML实现网页

效果图:

代码实现:

样式部分style.css:

*{
    margin: 0;
    padding: 0;
}
body{
    background-color: #673929;
    font-size: 16px;
    font-family: "微软雅黑"
}
#conters{
    margin: 0 auto;
    width: 900px;
}

#header{
    height: 220px;
    margin-bottom: 5px;
    position: relative;
}
#icon-list{
    position: absolute;
    top:170px;
    right: 30px;
    width: 130px;
    height: 30px;
    /*
    font-size: 0;*/
}

#nav{
    height: 30px;
    background: #09c;
    margin-bottom: 5px;
    font:18px/30px 微软雅黑;
    color: #fff;
    letter-spacing: 2px;
    text-align: center;
}
#nav a{
    text-decoration: none;
}
a:link{
    color: white;
}
a:hover{
    color: yellow;
}
a:visited{
    color: white;
}
a:active{
    color: purple;
}

#main{
   background-color: red;
/*   margin-bottom: 5px;*/
}
#aside{
    width: 300px;
    float: left;
    background: #6cf;
    text-align: center;
    font-size: 14px;
    color: #000;
}

#aside h2{
    color: black;
    text-align: center;
    margin-top: 2em;
    letter-spacing: 1px;
}
#imglist{
    width: 130px;
    margin:0 auto;

}
.pol{
    width: 170px;
    padding: 10px;
    background-color: #eee;
    border:1px solid #bfbfbf;
    box-shadow: 2px 2px 4px #aaa;
    border-radius: 5px;
}
#imglist img{
    width: 65px;
    height: 75px;
    margin:0 auto;
    font-size: 0;
}
.rotate-left{
    transform:rotate(7deg);
    -webkit-transform-style: rotate(7deg);
    -moz-transform-style: rotate(7deg);
    -ms-transform-style: rotate(7deg);
    transform-style: rotate(7deg);
}
.rotate-right{
    transform:rotate(-7deg);
    -webkit-transform-style: rotate(-7deg);
    -moz-transform-style: rotate(-7deg);
    -ms-transform-style: rotate(-7deg);
    transform-style: rotate(-7deg);
}
#inglist img:hover{
    -webkit-transform-style: scale(1.2);
    -moz-transform-style: scale(1.2);
    -ms-transform-style: scale(1.2);
    transform-style: scale(1.2);
}
#aside th{
    font-weight: 1px;
    letter-spacing: 1px;
}
#aside table{
    text-align: center;
    padding: 10px;
}

#content{
    width: 595px;
    float: right;
    background-color: #cff;
    margin-bottom: 5px;
}
.subcon{
     width: 570px;
     margin:10px auto;
     clear: both;
 /*    border:1px dashed #000;*/
}
.subcon img{
    margin:5px;
    padding: 5px;
    float: left;

}
.subcon .suntext{
    width: 60px;
    float: left;
    margin:5px;
}
.subcon h2{
    margin:5px;
    color: #673929;

}
.subcon p{
    font:16px/2em;
}

#footer{
/*    width: 900px;*/
    height: 60px;
    line-height: 60px;
    background-color: #6cf;
    clear: both;
    margin-top: 5px;
    text-align: center;
}
#fix{
    position: fixed;
    top: 100px;
    left:5px;

}
#fix img{
    height: 100px;
    width: 100px;
}

整体结构部分index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>咖啡店</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div id="conters">
        <div id="header">
            <p><img src="images/banner.jpg" ></p>
            <div id="icon-list">
                <img src="images/1.bmp" alt="">
                <img src="images/2.bmp" alt="">
                <img src="images/3.bmp" alt="">
                <img src="images/4.bmp" alt="">
            </div>
        </div>
        <div id="nav">
            <a href="#">咖啡MENU|</a>
            <a href="#">咖啡COOK|</a>
            <a href="#">咖啡STORY|</a>
            <a href="#">咖啡NEWS|</a>
            <a href="#">咖啡PARTY</a>
        </div>
        <div id="main">
            <div id="aside">

                <div id="menu">
                    <h2>咖啡MENU</h2>
                    <table>
                        <th>
                            <tr>
                                <td> </td>
                                <td>拿铁</td>
                                <td>卡不起落</td>
                                <td>摩卡</td>
                                <td>农博园</td>
                            </tr>
                            <tr><td> </td>
                                <td>uius</td>
                                <td>whd</td>
                                <td>duhd</td>
                                <td>dwhu</td>
                            </tr>
                        </th>
                        <tr>
                            <td>大杯</td>
                            <td>45</td>
                            <td>35</td>
                            <td>35</td>
                            <td>35</td>
                        </tr>
                        <tr>
                            <td>中杯</td>
                            <td>25</td>
                            <td>25</td>
                            <td>25</td>
                            <td>25</td>
                        </tr>
                        <tr>
                            <td>小杯</td>
                            <td>15</td>
                            <td>15</td>
                            <td>15</td>
                            <td>15</td>
                        </tr>
                    </table>
                    <div id="imagelist">
                        <div class="pol rotate-left"><img src="images/Cappuccino.jpg" alt=""></div>
                        <div class="pol rotate-right"><img src="images/Espresso.jpg" alt=""></div>
                        <div class="pol rotate-left"><img src="images/Mocha.jpg" alt=""></div>
                        <div class="pol rotate-right"><img src="images/Latte.jpg" alt=""></div>
                    </div>
                </div>
                <div class="box">

                </div>
                </div>
            </div>
            <div id="content">
                <div class="subcon">
                    <img src="images/Cappuccino.jpg" alt="">
                    <div class="subtext">
                        <h2>咖啡名称</h2>
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates, blanditiis tenetur natus illum velit.</p>
                    </div>
                </div>
                <div class="subcon">
                    <img src="images/Espresso.jpg" alt="">
                    <div class="subtext">
                        <h2>咖啡名称</h2>
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates, magni voluptatum illum tempore voluptatem iste.</p>
                    </div>
                </div>
                <div class="subcon">
                    <img src="images/Latte.jpg" alt="">
                    <div class="subtext">
                        <h2>咖啡名称</h2>
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae esse nisi, nulla, aliquid architecto molestias.</p>
                    </div>
                </div>
                <div class="subcon">
                    <img src="images/Mocha.jpg" alt="">
                    <div class="subtext">
                        <h2>咖啡名称</h2>
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque, molestiae labore tenetur dolores ipsam dicta!</p>
                    </div>
                </div>
                <div class="subcon">
                    <img src="images/Latte.jpg" alt="">
                     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas nulla architecto quos possimus ratione deserunt, explicabo id odit eaque deleniti minus enim perferendis maiores impedit tempora eius sequi fuga quia.</p>
                </div>
            </div>
        </div>
        <div id="footer">
            <p>我是页脚哇!!</p>
        </div>
    </div>
    <div id="fix">
        <img src="images/Latte.jpg" alt="">
        <p>我是广告域哇</p>
    </div>
</body>
</html>

原文地址:https://www.cnblogs.com/kaoju/p/12623847.html

时间: 2024-08-16 04:53:29

CSS3+CSS+HTML实现网页的相关文章

使用 CSS 去掉 iPhone 网页上按钮的默认圆角样式

使用 CSS 去掉 iPhone 网页上按钮的默认圆角样式 使用 iPhone 上的浏览器去浏览网页的时候,按钮总是显示超大圆角的样式,显得超级恶心,但是我们自己定义 border-radius 也没有效果,经过搜索发现这是 webikt 内核浏览器通过私有属性 -webkit-appearance 对控件设置了默认样式. input {-webkit-appearance:none; /*去除input默认样式*/} input[type="submit"], input[type=

利用CSS制作静态网页的注意事项

利用CSS制作静态网页主要是在<head>里面使用外联CSS文件来赋予网页样式 首先用div分区块,了解网页布局,脑子里面有个大概的页面布局 目前学习写的几种的网页布局可以分为以下几种情况: 1.页面中间 centen ,两边留白 :直接测量 centen 内容的宽度和高度,利用 maigin:auto 让内容居中即可: 2.页面顶部 head 满页面内容 ,下面centen 居中 ,两边留白:head 宽度设为100%,中间centen 内容的宽度和高度,利用 maigin:auto 让内容

运用CSS对静态网页进行布局和效果设置

CSS中对静态网页的布局和定位已经较为成熟  现在运用CSS(层叠样式表)已经可以对静态网页的色彩搭配 .图片点击效果.列表外观进行设置 较使用时间较长的JS有了很大提升  而HTML5在图片和基本的点击事件以及动画上面也有了很多提升   使HTML5超前完成了JS可以完成的工作任务 以下列出CSS中静态网页布局需要使用到的一些元素 要使网页页面美观  我们需要对网页进行大小 .背景图片(或背景颜色).以及网页内的文字和网页的所属小的版块位置的设置 1.网页基本属性的构成 border:延用HT

基于CSS的个人网页

前端时间做的CSS作业:基于CSS的个人网页 基于CSS的个人网页 效果图: 代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>吴广林的个人博客</title> <link rel="stylesheet" href="css/style.css"> </head> <

HTML、CSS、JavaScript网页制作从入门到精通 (刘西杰) pdf扫描版彩色版?

html.css.JavaScript网页制作从入门到精通中从基础知识开始讲起,如html的基本标记.文字与段落标记.表格标记.超链接标记--同时介绍了目前流行的web标准与css网页布局实例,以及基于语言的网页特效制作.需要的朋友们可以下载看看! HTML\CSS\JavaScript网页制作从入门到精通共分为18章和4个附录,重点介绍使用HTML进行网页制作的方方面面,同时讲解了目前流行的Web标准与CSS网页布局实例,以及基于JavaScript语言的网页特效制作.为了便于读者学习,附录中

CSS3之绽放的花朵(网页效果--每日一更)

今天,带来的是纯CSS3打造的效果--绽放的花朵. 先来看效果吧:http://webfront.verynet.cc/pc/flower.html 这是纯CSS3样式打造的效果,关键是采用了animation属性和transform属性.详细请看下面代码. HTML结构: 1 <div class="div1"></div> 2 <div class="div2"></div> 3 <div class=&qu

HTML5+CSS3的响应式网页设计:自动适应屏幕宽度

这几天都在修改博客上面的样式.本来用的是d83.0的模板.自己又修改了许多地方,其中自己修改的一些地方在手机里面显示的效果不是很理想,于是想改成自适应的效果.对CSS3不是特别的熟练,只能去网上找找案例看了.发现一个不错的文章.写的比较入门,也很仔细.所以拿过来分享给大家.如果还想看图片的响应式案例可以看我找的另外的一篇<分享一个非常有用的HTML5+CSS3响应式图片案例>. 移动设备正超过桌面设备,成为访问互联网的最常见终端.于是,网页设计师不得不面对一个难题:如何才能在不同大小的设备上呈

使用CSS3 Media Queries实现网页自适应

原文来源:http://webdesignerwall.com 翻译:http://xinyo.org 当今银屏分辨率从 320px (iPhone)到 2560px (大屏显示器)或者更大.人们也不再仅仅用台式机来浏览网页,现在有手机,平板电脑等等.所以传统的固定宽度设计形式将不再是个最佳选择,网页设计需要有自适应性.网页的布局需要能够根据不同的分辨率和设备来自动调整,以达到到最佳显示效果.接下来会展示如何运用HTML5和CSS3来设计一个自适应网页. 效果预览代码下载 先看看它的效果 在开始

CSS3 Media Queries 实现网页自适应

文章转载自:爱思资源网http://www.aseoe.com/show-10-261-1.html 导语 接下来会展示如何运用 HTML5 和 CSS3 来设计一个自适应网页.当今银屏分辨率从 320px (iPhone) 到 2560px (大屏显示器) 或者更大.人们也不再仅仅用台式机来浏览网页,现在有手机,平板电脑等等.所以现在屏幕分辨率的范围很大,从 320px (iPhone) 到 2560px (大型显示器),甚至更大.用户也不只是使用台式电脑访问web站点了,他使用手机.笔记本电