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. 【android tools】内存、网络、界面性能响应优化的工具

    一.性能优化工具 性能分析,我理解有内存性能,IO性能, 界面性能,耗电等. 内存性能,用debuggable的app结合mat等专业工具可以分析.另外最近的Leakcanary很好用,但是要手动加入 ...

  2. [LintCode] Maximal Square 最大正方形

    Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and ret ...

  3. android-数据存储之SharedPreferences

    数据存储:SharedPreferences 一.基础概要 1.说明 1>主要用于存储单一小数据: 2>存储类型:boolean.float.String.long.int 3>数据 ...

  4. java.lang.UnsupportedClassVersionError: TwoSum : Unsupported major.minor version 52.0

    编译的版本比运行的版本高. 两台电脑,一个装的是jdk1.7,另一个是1.8,在1.8上运行之后,上传到github然后1.7的拉下来,再运行出现了上述错误. 解决方式:设置如下

  5. Linux下配置SVN

    1.安装svn yum -y install subversion 2.创建SVN版本库目录 mkdir -p /var/svn/svnrepos (-p参数:如果没有这个目录,则创建这个目录) 3. ...

  6. NYOJ-组合数

    #include <stdio.h> #include <malloc.h> int main() { ; ]; scanf("%d%d", &n, ...

  7. 【转】DNS记录类型介绍(A记录、MX记录、NS记录等)

    DNS A记录 NS记录 MX记录 CNAME记录 TXT记录 TTL值 PTR值 建站名词解释:DNS A记录 NS记录 MX记录 CNAME记录 TXT记录 TTL值 PTR值 泛域名 泛解析 域 ...

  8. php预定义变量,超全局变量,魔术方法,特殊函数变量使用

    <?php /* * 本代码全部为测试函数代码,部分注释和写实例 * * 修改php.ini variables_order=”EGPCS” * 请注意$_REQUEST在优先级传参的时候会造成 ...

  9. html基本的内容

    1.表现各标签的特征 <img>中的src(source)即为属性 属性都是以"属性名 = 值"的形式出现 属性的值建议用引号括起来 属性建议均以键值对的形式括起来 一 ...

  10. ArcMap中,如何查看当前工具是否在执行?如何将工具调到前台来执行?

    ArcMap中,如何查看当前工具是否在执行?如何将工具调到前台来执行? 描述 如何查看当前工具是否在执行?如何将工具调到前台来执行? 解决办法 后台GP执行中,可以在 Geoprocessing菜单中 ...