Image Opacity / Transparency

  • The CSS opacity property is a part of the CSS3 recommendation.

Example

 img {
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
} img:hover {
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
}

Image Sprites

  • An image sprite is a collection of images put into a single image.

Example

 <!DOCTYPE html>
<html>
<head>
<style>
#navlist {
position: relative;
} #navlist li {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 0;
} #navlist li, #navlist a {
height: 44px;
display: block;
} #home {
left: 0px;
width: 46px;
background: url('img_navsprites_hover.gif') 0 0;
} #prev {
left: 63px;
width: 43px;
background: url('img_navsprites_hover.gif') -47px 0;
} #next {
left: 129px;
width: 43px;
background: url('img_navsprites_hover.gif') -91px 0;
} #home a:hover {
background: url('img_navsprites_hover.gif') 0 -45px;
} #prev a:hover {
background: url('img_navsprites_hover.gif') -47px -45px;
} #next a:hover {
background: url('img_navsprites_hover.gif') -91px -45px;
}
</style>
</head>
<body> <ul id="navlist">
<li id="home"><a href="default.asp"></a></li>
<li id="prev"><a href="css_intro.asp"></a></li>
<li id="next"><a href="css_syntax.asp"></a></li>
</ul> </body>
</html>

CSS Attribute Selectors

  • Style HTML elements that have specific attributes or attribute values.

1> CSS [attribute] Selector

  • Used to select elements with a specified attribute.

2> CSS [attribute="value"] Selector

  • Used to select elements with a specified attribute and value.

Example

 a[target] {
background-color: yellow;
}
a[target="_blank"] {
background-color: blue;
}

3> CSS [attribute~="value"] Selector

  • Used to select elements with an attribute value containing a specified word.

4> CSS [attribute*="value"] Selector

  • Used to select elements whose attribute value contains a specified value.
 [title~=flower] {
border: 5px solid yellow;
}
title="klematis flower" > yes
title="flower" > yes
title="tree_flower" > no [class*="te"] {
background: yellow;
}
class="first_test" > yes
class="mytest" > yes

5> CSS [attribute|="value"] Selector

  • Used to select elements with the specified attribute starting with the specified value.

6> CSS [attribute^="value"] Selector

  • Used to select elements whose attribute value begins with a specified value.
 [class|=top] {
background: yellow;
}
class="top-header" > yes
class="top-text" > yes
class="topcontent" > no [class^="top"] {
background: yellow;
</style>
class="top-header" > yes
class="top-text" > yes
class="topcontent" > yes

7> CSS [attribute$="value"] Selector

  • Used to select elements whose attribute value ends with a specified value.
 [class$="test"] {
background: yellow;
}
class="first_test" > yes
class="my-test" > yes

CSS 笔记六(Image/Attribute Selectors)的更多相关文章

  1. (3)选择元素——(6)属性选择器(Attribute selectors)

    Attribute selectors are a particularly helpful subset of CSS selectors. They allow us to specify an ...

  2. 《MFC游戏开发》笔记六 图像双缓冲技术:实现一个流畅的动画

    本系列文章由七十一雾央编写,转载请注明出处.  http://blog.csdn.net/u011371356/article/details/9334121 作者:七十一雾央 新浪微博:http:/ ...

  3. HTML+CSS笔记 CSS笔记集合

    HTML+CSS笔记 表格,超链接,图片,表单 涉及内容:表格,超链接,图片,表单 HTML+CSS笔记 CSS入门 涉及内容:简介,优势,语法说明,代码注释,CSS样式位置,不同样式优先级,选择器, ...

  4. java之jvm学习笔记六-十二(实践写自己的安全管理器)(jar包的代码认证和签名) (实践对jar包的代码签名) (策略文件)(策略和保护域) (访问控制器) (访问控制器的栈校验机制) (jvm基本结构)

    java之jvm学习笔记六(实践写自己的安全管理器) 安全管理器SecurityManager里设计的内容实在是非常的庞大,它的核心方法就是checkPerssiom这个方法里又调用 AccessCo ...

  5. Learning ROS for Robotics Programming Second Edition学习笔记(六) indigo xtion pro live

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...

  6. Python学习笔记六

    Python课堂笔记六 常用模块已经可以在单位实际项目中使用,可以实现运维自动化.无需手工备份文件,数据库,拷贝,压缩. 常用模块 time模块 time.time time.localtime ti ...

  7. Typescript 学习笔记六:接口

    中文网:https://www.tslang.cn/ 官网:http://www.typescriptlang.org/ 目录: Typescript 学习笔记一:介绍.安装.编译 Typescrip ...

  8. Django开发笔记六

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.登录功能完善 登录成功应该是重定向到首页,而不是转发 ...

  9. python3.4学习笔记(六) 常用快捷键使用技巧,持续更新

    python3.4学习笔记(六) 常用快捷键使用技巧,持续更新 安装IDLE后鼠标右键点击*.py 文件,可以看到Edit with IDLE 选择这个可以直接打开编辑器.IDLE默认不能显示行号,使 ...

随机推荐

  1. LaTex Remove Left Margin 去除左边空间

    LaTex中使用itemize的时候,默认的每一项左边都有一小段距离,并不是紧贴着边缘的,那么如果我们想去掉这段距离,我们可以使用下面的命令: \usepackage{enumitem} \setli ...

  2. 学习使用vim,熟悉Linux

    随着对vim一步一步的熟悉,对Linux的资料查阅,在加上今天阅读了王垠的文章,更加的觉得学习vim是正确的选择.抛弃Windows思维,进入Linux的世界,才发现是思维上的转变,如学习英语一样,是 ...

  3. winform 打印控件

    (1)PageSetupDialog1    打印设置窗口  (2)PrintDocument     向打印机输送的对象 事件:PrintPage   对于打印的每一页都执行一次 (3)PrintP ...

  4. IE hack中主要的几个

    _: IE6; #*+.: IE6 IE7; black\0: IE8; black\9: IE所有; @media screen\9 { … }: IE6 IE7; @media \0screen\ ...

  5. 一次熬夜解决的java乱码问题

    在java  API中String有一个方法 public byte[] getBytes() Encodes this String into a sequence of bytes using t ...

  6. IOS第12天(1,UIViewController控制器的创建的 三种方式,和第一个view创建)

    *************HMAppDelegate.m中 @implementation HMAppDelegate - (BOOL)application:(UIApplication *)app ...

  7. 虚拟机安装Macintosh探索

    想跟virtualbox安装一个mac os,在pcbeta找到网友分享的原版镜像,挂载安装,结果在安装的时候不是卡在进入界面,就是不停地安装,显然没有那么简单.virtualbox 在用户手册写着支 ...

  8. linux命令学习(2):wc 命令

    Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项]文件... 2.命令功能: 统计指定文件中的字节数. ...

  9. Cocos2dx集成于windows桌面窗口程序的步骤

    2D游戏需要做编辑器,而编辑器总是希望可以复用游戏中的逻辑来运行场景试看效果. 对于cocos2dx开发的程序,这个需求可以描述为: 实现一种方法,在桌面窗口程序中的某个控件上显示cocos2dx的场 ...

  10. hadoop2.5重新编译问题

    这几天一直在搭建hadoop环境,由于2.5以及2.6的版本需要在64位环境下重新编译,所以中间走了不少弯路.现在总结一下,由于手头资源紧张,只能在pc上模拟环境,具体环境如下: 宿主机:联想的笔记本 ...