---
title: "css3新特性-新增3个属性选择器"
author: "小丑鱼0703"
date: "2015-01-09T10:30:21Z"
tags: []
categories: ["Web前端"]
slug: "css3-3"
draft: false
lastmod: "2015-01-09T10:30:21Z"
id: 2174229
url: "https://wangjingyi.iteye.com/blog/2174229"
---

CSS3在CSS2的基础上对属性选择器进行了扩展,使得属性选择器有了通配符的概念。

![](http://dl2.iteye.com/upload/attachment/0105/0778/749cb6fa-06c4-3bc3-be3b-d8422f738eb9.png)



```html

<style type="text/css">
a[class^=column]{
    background:red;
    }
a[href$=doc]{
    background:green;
}
a[title*=box]{
    background:blue;
}
</style>
</head> 
<body>
<a href="##" class="columnNews">背景红色</a>
<a href="##" class="columnVideo">背景红色</a>
<a href="##" class="columnAboutUs">背景红色</a><br/>
<a href="1.doc">背景绿色</a>
<a href="2.doc">背景绿色</a><br/>
<a href="##" title="this is a box">背景蓝色</a>
<a href="##" title="box1">背景蓝色</a>
<a href="##" title="two boxs">背景蓝色</a>
</body>

```