CSS兼容性(2) text overflow
一直以来我都以为css是无法限制字符长度的,最近才发现原来可以这样.最简单的兼容方法:
.textOverflow {
width:100px;
white-space:nowrap;/*限制单行输出*/
text-overflow:ellipsis;/*只支持IE6(+)*/
overflow: hidden;
-o-text-overflow: ellipsis;/*Opera专用*/
-moz-binding: url('ov.xml#ellipsis');/*firefox下实现要配套对应的xml文件*/
}
/*.xul是为<xul:description>添加的class属性*/
.xul{
color:#fff;
}
html代码:
<div class="textOverflow">块级元素块级元素块级元素块级元素块级元素块级元素</div>
根目录下ov.xml文件代码:
<?xml version="1.0" encoding="utf-8"?>
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<binding id="ellipsis">
<content>
<xul:description class="xul" crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
</content>
</binding>
</bindings>
现在网上很多是流行js方法来兼容ff的,其实上述介绍的是用了xul:description的方法,^_^我也不知道那是啥来的,不过这样写很简洁。
关于xul的教程《XUL教程》
相关文档:
function $import(path,type,title,idname){
var s,i;
if(type=="js"){
&nb ......
今天我们汇总了许多div+css网页设计中经常用到的经验和技巧,大家可以多多参考,对你的页面设计一定有很大的帮助!
如果文字过长,则将过长的部分变成省略号显示:IE5,FF无效,但可以隐藏,IE6有效DIV STYLE=“width:120px;height:50px;border:1px solid blue;overflow:hidden;text-overflow:ellipsis&rdquo ......
盒子标签和属性对照
CSS语法(不区分大小写)
JavaScript语法(区分大小写)
border
border
border-bottom
borderBottom
border-bottom-color
borderBottomColor
border-bottom-style
borderBottomStyle
border-bottom-width
borderBottomWidth
border-color
borderColor
border-left
borderLeft
border ......
在网页设计中,table用height:100%是可以整屏的,但需要在网页头部增加:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
后就和没 ......
magento个别页面添加css和js文件,可以将其放在个别页面的xml中,或者放在CMS的layout update中,其代码和文件存放位置如下
<reference name="head">
<action method="addCss"><stylesheet>css/mystyles.css</stylesheet></action>
//添加css mystyles.css 文件在 /skin/frontend/主题包 ......