id选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!--id选择器-->
<style>
#i{
background-color: bisque ;
height: 48px;
}
</style>
</head>
<body>
<div id="i">属性</div>
<div></div>
<div></div>
</body>
</html>

id 选择器

div 标签选择器

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
div{
background-color: aqua;
height: 48px;
}
</style>
</head>
<body> <div class="c1">头</div>
<span class="c1">行内标签 自己有多少占多少
<div class="c1"> ff</div>
</span> <div class="c1">尾</div> </body>
</html>

div 标签选择器

类选择器-最常用

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head> <style>
.c1{
background-color: aqua;
height: 48px;
}
</style> <body> <div class="c1">头</div>
<span class="c1">行内标签 自己有多少占多少</span>
<div class="c1">尾</div> </body>
</html>

类选择器-最常用

组合选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!--组合选择器用逗号-->
<style> .i, .j, .k{
background-color: aqua;
height: 48px;
} #a,#b,#c{
background-color:indianred;
height: 48px;
} </style> </head>
<body>
<div class="i">明天你好</div>
<div class="j">的师傅</div>
<div class="k">腹股沟方法</div>
<br/>
<br/>
<div id="a">明天你好</div>
<div id="b">的师傅</div>
<div id="c">腹股沟方法</div>
</body>
</html>

组合选择器

属性选择器

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
input[type='text']{ background-color: aqua; height: 48px;}
input[n='pwd']{ background-color:red; height: 2px;}
</style>
</head>
<body>
<div>
<input type="text"/>
<input n="pwd"/> </div>
</body>
</html>

属性选择器

python: HTML中的选择器的更多相关文章

  1. Python正则表达式中的re.S

    title: Python正则表达式中的re.S date: 2014-12-21 09:55:54 categories: [Python] tags: [正则表达式,python] --- 在Py ...

  2. python语言中的编码问题(续)

    上文提到了python开发中非常重要的两处设置. 一个是编解码器的默认设置defaultencoding >>> import sys >>> sys.getdef ...

  3. Python类中super()和__init__()的关系

    Python类中super()和__init__()的关系 1.单继承时super()和__init__()实现的功能是类似的 class Base(object): def __init__(sel ...

  4. 在Python应用中使用MongoDB

    Python是开发社区中用于许多不同类型应用的强大编程语言.很多人都知道它是可以处理几乎任何任务的灵活语言.因此,在Python应用中需要一个什么样的与语言本身一样灵活的数据库呢?那就是NoSQL,比 ...

  5. python虚拟机中的异常流控制

    异常:对程序运行中的非正常情况进行抽象.并且提供相应的语法结构和语义元素,使得程序员能够通过这些语法结构和语义元素来方便地描述异常发生时的行为. 1.Python中的异常机制: 1.1Python虚拟 ...

  6. python 继承中的super

    python继承中子类访问父类的方法(包括__init__)主要有两种方法,一种是调用父类的未绑定方法,另一种是使用super(仅仅对于新式类),看下面的两个例子: #coding:utf-8 cla ...

  7. 记录Python学习中的几个小问题

    记录Python学习中的几个小问题,和C#\JAVA的习惯都不太一样. 1.Django模板中比较两个值是否相等 错误的做法 <option value="{{group.id}}&q ...

  8. python环境中运行程序

    运行Python程序,我们比较常用的是直接在Windows命令提示窗口或者Linux终端或shell窗口中,直接:Python *.py,或者在Linux环境下,在投不中,加入: #!/usr/bin ...

  9. Python编程中的反模式

    Python是时下最热门的编程语言之一了.简洁而富有表达力的语法,两三行代码往往就能解决十来行C代码才能解决的问题:丰富的标准库和第三方库,大大节约了开发时间,使它成为那些对性能没有严苛要求的开发任务 ...

随机推荐

  1. django数据库动态添加列

    方法一: python manage.py migrate 方法二: python manage.py migrate 效果: ---〉

  2. css限制div字符超出部分,简单有方便

    text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-w ...

  3. HDU3732 背包DP

    Ahui Writes Word Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  4. 安装repcached,并且测试其双向复制是否成功

    备注:本实验不仅包括了repcached,还包括了memcache的配置安装 1.1实验环境. 1.2环境准备. 1.3配置一个memcache. 1.3.1安装memcache. 1.3.2启动me ...

  5. 超文本引用href的几种用法

    href="要跳转目标链接"; href="#";当前页面不跳转(返回顶部) href="###";当前页面不跳转(同时不回到顶部) hre ...

  6. 在python 中is和= = 的区别

    Python中的对象包含三要素:id.type.value其中id用来唯一标识一个对象,type标识对象的类型,value是对象的值is判断的是a对象是否就是b对象,是通过id来判断的==判断的是a对 ...

  7. GDC2016 Epic Games【Bullet Train】 新风格的VR-FPS的制作方法

    追求“舒适”和“快感”的VR游戏设计方法   http://game.watch.impress.co.jp/docs/news/20160318_749016.html     [Bullet Tr ...

  8. buffer pool

    https://dev.mysql.com/doc/refman/5.5/en/glossary.html#glos_buffer_pool buffer pool The memory area t ...

  9. java 求 两个数的百分比% (转)

    int num1 = 7; int num2 = 9; // 创建一个数值格式化对象 NumberFormat numberFormat = NumberFormat.getInstance(); / ...

  10. android发送/接收json数据

    客户端向服务器端发送数据,这里用到了两种,一种是在url中带参数,一种是json数据发送方式: url带参数的写法: url+/?r=m/calendar/contact_list&uid=3 ...