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 ...
随机推荐
- tomcat manager配置
在tomcat-user.xml里面配置 <tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi=" ...
- * {margin:0px; padding:0px;}什么意思?
* {margin:0px; padding:0px;} * 表示所有的元素的对齐方式以及和父类之间的间距都为0 body{margin:0px;padding:0px;} body里面的则表示的是 ...
- @UniqueConstraint
jedis UniqueConstraint定义在Table或SecondaryTable元数据里,用来指定建表时需要建唯一约束的列. 元数据属性说明: columnNames:定义一个字符串数组,指 ...
- java类型占用字节数&类型转换
1.整型类型 存储需求 bit数 取值范围 备注int 4字节 4*8 short ...
- XML.04-dom4j和XPath
body,td { font-family: calibri; font-size: 10pt } XML.04-dom4j和XPath dom4j的基本使用 XPath 啥是XPath XPath语 ...
- jQuery控件有所感悟
两种写法对比: 第一种: ;(function($){ $.fn.myplugin = function(op,params){ if (typeof op == 'string'){ return ...
- Spring pom配置详解
转载至http://blog.csdn.net/ithomer/article/details/9332071# 原博主注释的很详细 <project xmlns="http://ma ...
- Winform 中DataGridView控件添加行标题
有很多种方法. 1.可以在DataGridView控件中的RowStateChanged事件改变行标题单元格的值(Row.HeaderCell.Value) /// <summary> / ...
- Python中出现的异常
简单的写几种我知道的关于Python中出现的异常含义,希望大神批评指正,我只是学软件开发的菜鸟,前面的路还很长,我会努力学习! 什么是异常? 异常既是一个事件,该事件会在程序执行过程中发生,影响了程序 ...
- DIOCP之工作流程图
晚上更新,请大家多多理解,最近比较忙