14、css高级属性

来源:互联网 发布:linux上安装maven 编辑:程序博客网 时间:2024/06/13 13:34

1、overflow 超出

    visible 超出不隐藏
    hidden 超出隐藏
    scroll 超出显示滚动条 
    auto 自动 超出显示滚动条

2、text-overflow: 文本溢出

    clip:文本被修剪
    ellipsis; 显示省略符号来代表被修剪的文本

3、white-space:

    nowrap 控制文本不换行
    pre 空白会被浏览器保留
    pre-line 合并空白  保留换行符
    pre-wrap 保留空白  正常换行

<!doctype html><!--声明当前文档为html文档--><html lang="en"><!--语言为英语--><head><!--头部--><meta charset="UTF-8"><!--字符编码:utf-8国际编码  gb2312中文编码--><meta name="Keywords" content="关键词"><meta name="Description" content="描述"><title>文本溢出</title><style>/*css样式表的衣柜*/*{margin:0px;padding:0px;}/*去除默认外边距、内边距*/p{width:100px;height:20px;border:1px solid red;white-space:nowrap;/*控制文本在一行内显示*/overflow:hidden;text-overflow:ellipsis;/*文本溢出显示省略号*/margin-bottom:100px;}div{width:100px;height:20px;border:1px solid red;/*white-space:nowrap;控制文本在一行内显示*/overflow:hidden;text-overflow:ellipsis;/*文本溢出显示省略号*/}div:hover{overflow:visible;/*超出可见*/text-overflow:inherit;/*文本溢出 继承*/}</style></head><body><!--身体--><p title="语言为英语语言为英语语言为英语语言为英语语言为英语语言为英语语言为英语">语言为英语语言为英语语言为英语语言为英语语言为英语语言为英语语言为英语</p><div><nobr>语言为英语语言为英语语言为英语语言为英语语言为英语语言为英语语言为</nobr> <!--nobr标签w3c暂不支持--></div></body></html>

4、opacity 透明度

    对于IE6/7/8 filter:alpha(opacity:值;)  值为0-100
    其他浏览器:opacity:0-1 小数
    {
        opacity:0.5;
        filter:alpha(opacity:50);
        -moz-opacity:0.5;
//低版本的火狐浏览器
}

5、bgsound 插入背景音乐 只适用于IE 

    <bgsound src="音频的路径" loop=2 > loop:表示重复播放的次数,loop=2表示重复两次
    infinite 无限重复  loop = -1 无限重复

6、<embed> 插入音频/视频

    <embed src=“media/music.mp3”  loop=2 >
0 0
原创粉丝点击