订阅本栏目 RSS您所在的位置: 深山工作室 > DIV+CSS > 正文

一个超级变态的DIV+CSS

深山行者个人网站 2008/6/20 12:43:11 深山行者 字体: 浏览 7749

一个超级变态的DIV+CSS

1. E[att^="string"] {property: value;} where E is a selector.

最终显示的结果就是:在以P为标签里,只要他的里面包函"ho"那么它的背景就为绿的

CSS:

p[title^="ho"] {background: green;}


HTML:

<p title="home">
  This paragraph should have a green background.
</p>
<p title="contact">
  The attribute selector doesn’t match this paragraph.
</p>
<p title="house">
  This paragraph should have a green background.
</p>
<p>
  The attribute selector doesn’t match this paragraph.
</p>
<p title="hot">
  This paragraph should have a green background.
</p>


 

以下为详细代码

2. E[att$="string"] {property: value;} where E is a selector.

最终显示的结果就是:在以P为标签里,只要他的里面不包函" t ",那么它的背景就为绿的

css:

p[title$="t"] {background: green;}

html:

<p title="home">
  The attribute selector doesn’t match this paragraph.
</p>
<p title="contact">
  This paragraph should have a green background.
</p>
<p title="house">
  The attribute selector doesn’t match this paragraph.
</p>
<p>
  The attribute selector doesn’t match this paragraph.
</p>
<p title="hot">
  This paragraph should have a green background.
</p>

以下为详细代码
3. E[att*="string"] {property: value;} where E is a selector.

最终显示的结果就是:在以P为标签里,只要他的里面模糊包函" ont ",那么它的背景就为绿的

css:

p[title*="ont"] {background: green;}

html:

<p title="home">
  The attribute selector doesn't match this paragraph.
</p>
<p title="contact">
  This paragraph should have a green background.
</p>
<p title="house">
  The attribute selector doesn't match this paragraph.
</p>
<p>
  The attribute selector doesn't match this paragraph.
</p>
<p title="hot">
  The attribute selector doesn't match this paragraph.
</p>


以下为详细代码
相关阅读
PS常用密技
微信小程序打开客服提示:该小程序提供的服务出现故障,请稍后重试
Google的265导航站上顶部右边的logo上的眼珠特效 (兼容IE,FF)
亿菇缘
利用CSS的position定位属性定义一个顶部飘动的柳叶效果非常酷
微信小程序直播组件live-player-plugin(wx2b03c6e691cd7370)
ASP汉字转拼音,支持自定义特殊词语
深山工作室
更多信息>>栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
DIV+CSS
HTML
python
更多>>同类信息
jquery设置或获取修改classname
利用css3.0写出一个音乐播放的唱片碟盘的效果
利用css中的scale()实现放大缩小效果
利用background-color:#000000a8在背景颜色16进制代码之后加字母加上数字让背景色透明
css背景使用base64编码或者将base64编码放在img图片标签中
利用css3中的-webkit-font-smoothing把网页文字的毛边去掉
更多>>最新添加文章
dw里面查找替换使用正则删除sqlserver里面的CONSTRAINT
Android移动端自动化测试:使用UIAutomatorViewer与Selenium定位元素
抖音直播音挂载小雪花 懂车帝小程序
javascript获取浏览器指纹可以用来做投票
火狐Mozilla Firefox出现:无法载入您的Firefox配置文件 它可能已经丢失 或是无法访问 问题解决集合处理办法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
python通过代码修改pip下载源让下载库飞起
python里面requests.post返回的res.text还有其它的吗
更多>>随机抽取信息
在网页标题栏上或收藏夹前面显示网站ico小图标的方法
深山旅行社网站管理系统 v1.7
巧用ASP技术保护DHTML源代码
添加一个防下载字段(长二进制数据)来防止ACCESS数据库被下载
深山文章管理系统 v1.0 bulid 090418
山西省太原夏日阳光国际旅行社