进行页面设计,分享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&
相关文档:
css控制位置:
纯数字
el.style.posLeft = 0;
el.style.posTop = 0;
数字+单位
el.style.left = "0px";
el.style.top = "0px";
css控制元素的样式:
document.getElementById("para").style.fontWeight ="bold";
或(其他也是这样):
document.getElementById("para").className ="strong"; ......
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 ......
來源:http://www.webjx.com/css/divcss-17091.html
中文原文:CSS在Internet Explorer 6, 7 和8中的差别
译自:CSS Differences in Internet Explorer 6, 7 and 8
关于浏览器的最离奇的统计结果之一就是Internet Explorer
版本6,7和8共存。截至本文,Internet Explorer各个版本总共占据了大约65%的市场 ......
overflow从字面意义上来讲就是溢出的意思,换句话说,你有个层,但是里面的内容,图片或者文字要比层大,overflow就是针对这种情况进行处理的。
包含4个属性值,visible,hidden,auto,scroll
visible就是超出的内容仍然正常被显示出来。
hidden就是超出的内容被隐藏。 &nbs ......
我喜欢3栏布局的网页设计,但是3栏布局相对来说就比较复杂,有些难以控制,尽管时下正火的Web2.0似乎很少采用3栏布局。但没关系,我们是非非非主流。
首先,任何一个布局通常都有headers, navigation bars, content containers,
......