进行页面设计,分享DIV+CSS一些小规则
在进行页面设计的时候,相信下面这些东西应该能够帮助你,DIV+CSS,希望可以为你节省一点时间。
一、 善用css缩写规则
/*注意上、右、下、左的书写顺序*/
1. 关于边距(4边):
1px 2px 3px 4px (上、右、下、左)
1px 2px 3px (省略的左等于右)
1px 2px (省略的上等于下)
1px (四边都相同)
2. 简化所有:
*/ body{margin:0}------------表示网页内所有元素的margin为0
#menu{ margin:0}------------表示menu盒子下的所有元素的margin为0
3. 缩写(border)特定样式:
Border:1px solid #ffffff;
Border-width:0 1px 2px 3px;
4. 关于文字的缩写规则:
Font-style:italic; 斜体形式
Font-variant:small-caps/normal; 变体样式:小型大写字母/正常
Font-weight:bold;
Font-size:12px;
Line-height:1.2em(120%)/1.5em(150%);
Font-family:arrial,sans-serif,verdana;
缩写成:
Font:italic small-caps bold 12px/1.5em arrial,sans-serif;
注意:Font-size和Line-height用斜杠组合在一起不能分开写。
5. 关于背景图片的:
Background:#FFF url(log.gif) no-repeat fixed top left;
6. 关于列表:
List-style-type:square/none;
List-style-position:inside;
List-style-image:url(filename.gif);
缩写成:
List-style:none inside url(filename.gif);
二、 运用4种方法来引入CSS样式
1.link
<link rel=”stylesheet” type=”text/css” href=”a.css”>
rel 关系
type 数据类型,有多种
href 路径
部分浏览器支持候选样式,关键字:alternate:
<link rel=”stylesheet” type=”text/css” href=”a.css”>
<link rel=”alternate stylesheet&
相关文档:
白色 #FFFFFF 2 红色 #FF0000 3 绿色 #00FF00 ......
I needed a tab pane to put some content in my web pages. There are many solutions around
and I must say that they are quite good, but I had some extra requirements that I needed.
I did search around but I did not find what I wanted, so I ended up producing something and now I am sharing
it with y ......
屏蔽IE浏览器(也就是IE下不显示)*:lang(zh) select {font:12px !important;} /*FF,OP可见,特别提醒:由于Opera最近的升级,目前此句只为FF所识别*/
select:empty {font:12px !important;} /*safari可见*/
这里select是选择符,根据情况更换。第二句是MAC上safari浏览器独有的。仅IE7与IE5.0可以识别*+html ......
内部样式表
内部样式表需要在网页的<head>部分定义,格式如下:
<head>
<style type="text/css">
/*符合CSS语法结构的CSS语句,例如*/
body { background-color: blue; }
</style>
</head>
行内样式表(内嵌样式表)
行内样式表直接在标签内部定义,使用style属性,写法如下:
......
// 按字符换行
style="word-break: break-all;"
// 按词组换行
style="word-wrap: break-word;"
==========================================================================
==========================================================================
font-family:Ari ......