css例子
6.背景图像渐变的制作
body{
background:#ccc url(xxx.gif)rpeat-x或y;
}
7.给一个区块加上背景
#branding{
width:700px;
height:20px;
background:url(xxx.gif)no-repeat;
}
8.给标题加上一个小图标
h1{
background:url(xxx.gif)no-repeat left center;
padding-left:20px;
}
如果希望使用百分比而不使用关键字,则0.50%这样就实现了垂直居中
9.圆顶角
<div>
<h2>...</h2>
<p>...</p>
</div>
div{
width:320px;
height:180px;
background:#ccc url(xxx.gif)no-repeat left bottom;
}
h2{
background:url(xxx.gif)no-repeat left bottom;
padding-left:40px;
}
10.简单的css阴影效果
<div>
<img src="xxx.jpg" />
</div>
div{
width:250px;
height:343px;
background:url(xxx.gif)no-repeat right bottom;
}
div img{
position:relative;
top:-2px;
left:-2px;
}
1.内边距与外边距
ul{
list-style-type:none;
margin:0;
padding:0;
}
ul{
list-style-type:none;
margin:0;
padding:0;
line-height:150%;
}
ul li{
krgound:url(xxx.gif)no-repeat left center;
padding-left:14px;
}
4.内联
ul与li本是区块
ul加上list-style-type:disc;
li加上display:inline;
可变成内联
5.背景图片和内联列表
ul{
list-style-type:none;
}
li{
display:inline;
background:url(xxx.gif)no-repeat left center;
margin:0 0 0 10px;
padding:0 0 0 15px;
}
6.垂直导航栏
<div>
<ul>
<li><a href="#">drubjs menu</a></li>
</ul>
</div>
ul{
list-style-type:none;
margin:5px;
padding:2px;
width:160px;
font-size:12px;
}
li{
brckground:#ddd;
margin:0;
padding:2px 10px;
border-left:1px solid #fff;
border-top:1px solid #fff;
border-ridht:1px solid #fff;
border-bottom:1px solid #fff;
}
7.创建垂直翻转的列表
ul{
margin:0;
padding:0;
list-style-type:none;
}
ul a{
display:block;
width:200px;
height:40px;
line-height:40px;
color:#000;
text-decoration:none;
background:#94b8e9 url(xxx.gif)no-repeat;
}
css例子的更多相关文章
- DIV+CSS例子
DIV水平居中+垂直居中 #main_zone{ width:1190px; height:570px; background-color:#fff; margin:0 auto; /*左右居中*/ ...
- css笔记01:CSS例子
body { margin:0; padding:0; background:#000 url('images/backgrounds/star.png') no-repeat fixed; font ...
- 网上的CSS例子编写都不太严谨,如*{ margin:0;padding:0;}
margin:0;padding:0; 一般情况下不可以用 *{margin:0;padding:0;} 来适配. 保证自己的严谨代码编写风格.
- 北京化妆时尚气息自适应CSS例子
三里屯太古广场——北京化妆时尚气息的先锋阵地! “乐色起义”创意化妆设计大赛——国内最具创意的公益设计大赛! CNature——国内最具个性的时尚环保公益组织! 一个多么奇妙的组合!就在2010年的这 ...
- CSS选择器的权重与优先规则?
我们做项目的时候,经常遇到样式层叠问题,被其他的样式覆盖,或者写的权重不高没效果,对权重没有具体的分析,做了一个总结. css继承是从一个元素向其后代元素传递属性值所采用的机制.确定应当向一个元素应用 ...
- CSS 概念 & 作用
http://www.cnblogs.com/moveofgod/archive/2012/09/18/2691101.html 式样定义 如何显示 HTML内容 通常存储在式样表中 作用 : 解 ...
- [转]CSS 模块
CSS 模块 如果你想知道 CSS 最近发展的转折点,你应该选择去观看 Christopher Chedeau 在2014年11月的 NationJS 大会上做的名称为 CSS in JS 的分享.不 ...
- 嗅探js css 文件是否加载成功示例
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Conten ...
- CSS学习摘要-语法和选择器
主要摘自网络开发者. 从最基本的层次来看,CSS是由两块内容组合而成的: 属性(Property):一些人类可理解的标识符,这些标识符指出你想修改哪一些样式,例如:字体,宽度,背景颜色等. 属性值(V ...
随机推荐
- python字符串及其方法详解
首先来一段字符串的基本操作 str1="my little pony" str2="friendship is magic" str3=str1+", ...
- caffe源码阅读(一)convert_imageset.cpp注释
PS:本系列为本人初步学习caffe所记,由于理解尚浅,其中多有不足之处和错误之处,有待改正. 一.实现方法 首先,将文件名与它对应的标签用 std::pair 存储起来,其中first存储文件名,s ...
- 微信支付之JSAPI开发第一篇-基本概念
申请权限 具体步骤就不说了,进入微信支付商户平台进行申请认证,认证成功后在微信公众号后台会有个微信支付的菜单按钮,点击后会有如下的信息 配置 在进行微信支付开发之前,必须进行一些必要的配置,如果这些配 ...
- RHEL7/CentOS7中更改网卡默认名称
1.重命名并修改网卡配置文件,将"NAME"参数更为我们熟悉的“eth*”,这里我将其改为"eth0" [root@localhost ~]# cd /etc/ ...
- Scala
简直就是java啊,mac上,下载,添加环境变量,source 就好了
- table 细边框
table { border-collapse: collapse; border: none; width: 200px; } td { border: solid #000 1px; }
- Qt窗口添加鼠标移动拖拽事件
1. .h文件中添加 private: QPoint dragPosition; 2. 在cpp文件中重写鼠标点击和拖拽函数 void ShapeWidget::mousePressEvent( ...
- Two Pointers Day
(1)Reverse String 解题思路简单明了,但是要注意时间复杂度问题!!! 代码如下:(声明一个与字符串等长的char数组,然后倒序区字符串中的字符,放入数组即可.) public clas ...
- asp.net TextBoxWatermark添加水印提示
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs& ...
- 循序渐进Python3(十)-- 2 -- SqlAlchemy
ORM 对象关系映射(英语:Object Relation Mapping,简称ORM,或O/RM,或O/R mapping),是一种程序技术,用于实现面向对象编程语言里不同类 ...