CSS选择器练习--餐厅选择
1.题目:Select the plates
答案:plate
1 <div class="table">
2 <plate></plate>
3 <plate></plate>
4 </div>
2.题目:Select the bento boxes
答案:bento
1 <div class="table">
2 <bento></bento>
3 <plate></plate>
4 <bento</bento>
5 </div>
3.题目:Select the fancy plate
答案:#fancy
1 <div class="table">
2 <plate id="fancy"></plate>
3 <plate></plate>
4 <bento</bento>
5 </div>
4.题目:Select the apple on the plate
答案:plate > apple 或者 plate apple
1 <div class="table">
2 <bento></bento>
3 <plate>
4 <apple/>
5 </plate>
6 <apple/>
7 </div>
8
5.题目:Select the pickle on the fancy plate
答案:#fancy pickle 或者 plate#fancy > pickle
1 <div class="table">
2 <bento>
3 <orange/>
4 </bento>
5 <plate id="fancy">
6 <pickle/>
7 </plate>
8 <plate>
9 <pickle/>
10 </plate>
11 </div>
12
6.题目:Select the small apples
答案:.small
1 <div class="table">
2 <apple/>
3 <apple class="small"/>
4 <plate>
5 <apple class="small" />
6 </plate>
7 <plate></plate>
8 </div>
7.题目:Select the small oranges
答案: orange.small
1 <div class="table">
2 <apple/>
3 <apple class="small"/>
4 <bento>
5 <orange class="small"/P>
6 </bento>
7 <plate>
8 <orange/>
9 </plate>
10 <plate>
11 <orange class="small"/>
12 </plate>
13 </div>
14
8.题目:Select the small oranges in the bentos
答案:bento orange.small 或者 bento > orange.small
1 <div class="table">
2 <apple/>
3 <plate>
4 <orange class="small"/>
5 </plate>
6 <bento>
7 <orange class="small"/>
8 </bento>
9 <bento>
10 <apple class="small"/>
11 </bento>
12 <bento>
13 <orange class="small"/>
14 </bento>
15 </div>
16
9.题目:Select all the plates and bentos
答案:plate,bento
1 <div class="table">
2 <pickle class="small" />
3 <pickle/>
4 <plate>
5 <pickle/>
6 </plate>
7 <bento>
8 <pickle/>
9 </bento>
10 <plate>
11 <pickle/>
12 </plate>
13 <pickle/>
14 <pickle class="small"/>
15 </div>
16
10.题目:Select all the things!
答案:*
1 <div class="table">
2 <apple/>
3 <plate>
4 <orange class="small"/P>
5 </plate>
6 <bento></bento>
7 <bento>
8 <orange/>
9 </bento>
10 <plate id="fancy"></plate>
11 </div>
12
11.题目:Select everything on a plate
答案:plate *
1 <div class="table">
2 <plate id="fancy">
3 <orange class="small" />
4 </plate>
5 <plate>
6 <pickle/>
7 </plate>
8 <apple class="small"/>
9 <plate>
10 <apple/>
11 </plate>
12 </div>
13
12.题目:Select every apple that's next to a plate
答案:plate + apple
1 <div class="table">
2 <bento>
3 <apple class="small"/>
4 </bento>
5 <plate></plate>
6 <apple class="small" />
7 <plate></plate>
8 <apple/>
9 <apple class="small" />
10 <apple class="small" />
11 </div>
13.题目:Select every pickle to the right of the bento
答案:bento~pickle
1 <div class="table">
2 <pickle/>
3 <bento>
4 <orange class="small"/P>
5 </bento>
6 <pickle class="small"/><pickle/>
7 <plate>
8 <pickle/>
9 </plate>
10 <plate>
11 <pickle class="small"/></plate>
12 </div>
13
14.题目:Select the apple directly on a plate
答案:plate > apple
1 <div class="table">
2 <plate>
3 <bento>
4 <apple/>
5 </bento>
6 </plate>
7 <plate>
8 <apple/>
9 </plate>
10 <plate></plate>
11 <apple/>
12 <apple class="small"/>
13 </div>
14
15.题目:Select the top orange
答案:plate > orange:first-child 或者 orange:first-child
1 <div class="table">
2 <bento></bento>
3 <plate></plate>
4 <plate>
5 <orange/><orange/>
6 <orange/></plate>
7 <pickle class="small" />
8 </div>
9
16.题目:Select the apple and the pickle on the plates
答案:plate>apple:only-child,plate>pickle:only-child
1 <div class="table">
2 <plate>
3 <apple/>
4 </plate>
5 <plate>
6 <pickle class="small"/P>
7 </plate>
8 <bento></bento>
9 <pickle/>
10 <plate>
11 <orange class="small"/><orange/>
12 </plate>
13 <pickle class="small"/>
14 </div>
17.题目:Select the small apple and the pickle
答案:apple,pickle 或者 apple:last-child,pickle:last-child
1 <div class="table">
2 <plate id="fancy">
3 <apple class="small"/>
4 </plate>
5 <plate></plate>
6 <plate>
7 <orange class="small"/P><orange/>
8 </plate>
9 <pickle class="small" />
10 </div>
18.题目:Select the 3rd plate
答案:plate:nth-of-type(3) 或者 plate:nth-child(3)
1 <div class="table">
2 <plate></plate>
3 <plate></plate>
4 <plate></plate>
5 <plate id="fancy"></plate>
6 </div>
19.题目:Select the 1st bento
答案:bento:nth-of-type(1) 或者 bento:nth-last-child(4)
1 <div class="table">
2 <plate></plate>
3 <bento></bento>
4 <apple class="small"/>
5 <plate>
6 <orange/>
7 <orange/>
8 <orange/>
9 </plate>
10 <bento></bento>
11 </div>
12
20.题目:Select first apple
答案:apple:first-of-type
1 <div class="table">
2 <apple/>
3 <apple class="small"/>
4 <apple class="small"/>
5 <apple class="small"/>
6 <plate>
7 <orange class="small"/><orange/>
8 </plate>
9 </div>
21.题目:Select all even plates
答案:plate:nth-child(even) 或者 plate:nth-of-type(2n)
1 <div class="table">
2 <plate></plate>
3 <plate</plate>
4 <plate</plate>
5 <plate></plate>
6 <plate id="fancy"></plate>
7 <plate></plate>
8 </div>
22.题目:Select every 2nd plate, starting from the 3rd
答案:plate:nth-of-type(2n+3)
1 <div class="table">
2 <plate></plate>
3 <plate>
4 <pickle class="small"/P>
5 </plate>
6 <plate>
7 <apple class="small" />
8 </plate>
9 <plate></plate>
10 <plate>
11 <apple/>
12 </plate>
13 <plate</plate>
14 </div>
23.题目:Select the apple on the middle plate.
答案:apple.small:only-of-type 或者 apple:only-of-type
1 <div class="table">
2 <plate>
3 <apple class="small" /><apple/>
4 </plate>
5 <plate>
6 <apple class="small" />
7 </plate>
8 <plate>
9 <pickle class="small"/P>
10 </plate>
11 </div>
24.题目:Select the second apple and orange
答案:orange:last-of-type,apple:last-of-type 或者 orange:nth-of-type(2),apple:nth-of-type(2)
1 <div class="table">
2 <orange class="small"/>
3 <orange class="small" />
4 <pickle/>
5 <pickle/>
6 <apple class="small"/>
7 <apple class="small"/>
8 </div>
25.题目:Select the empty bentos
答案:bento:empty 或者 bento:not(:nth-of-type(2))
1 <div class="table">
2 <bento></bento>
3 <bento>
4 <pickle class="small"/>
5 </bento>
6 <bento></bento>
7 <bento></bento>
8 </div>
26.题目:Select the big apples
答案:apple:not(.small) 或者 apple:not(#fancy>apple)
1 <div class="table">
2 <plate id="fancy">
3 <apple class="small" />
4 </plate>
5 <plate>
6 <apple/>
7 </plate>
8 <apple/>
9 <plate>
10 <orange class="small"/>
11 </plate>
12 <pickle class="small"/>
13 </div>
CSS选择器练习--餐厅选择的更多相关文章
- CSS选择器的组合选择器之后代选择器和子元素选择器
实例代码: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF ...
- CSS选择器:子选择符号
<html> <head> <style type="text/css"> .class>h2{color:red} </style ...
- CSS和CSS选择器
一:CSS CSS有三种书写形式(优先级从高到低) 1)行内样式:(内联样式)直接在标签style属性中书写 2)内页样式:在本网页的style标签中书写 3)外部样式:在单独的CSS文件中书写,然后 ...
- 常用xpath选择器和css选择器总结
xpath选择器 表达式 说明 article 选取所有article元素的所有子节点 /article 选取根元素article article/a 选取所有属于article的子元素的a元素 // ...
- HTML中放置CSS的三种方式和CSS选择器
(一)在HTML中使用CSS样式的方式一般有三种: 1 内联引用 2 内部引用 3 外部引用. 第一种:内联引用(也叫行内引用) 就是把CSS样式直接作用在HTML标签中. <p style ...
- 爬虫学习笔记(2)--创建scrapy项目&&css选择器
一.手动创建scrapy项目---------------- 安装scrapy: pip install -i https://pypi.douban.com/simple/ scrapy 1 ...
- Selenium(五):CSS选择器(二)
1. CSS选择器 1.1 选择语法联合使用 CSS selector的另一个强大之处在于:选择语法可以联合使用. html代码: <div id='bottom'> <div cl ...
- Selenium(四):CSS选择器(一)
1. CSS选择器 前面我们学习了根据 id.class属性.tag名选择元素. 如果我们要选择的元素没有id.class 属性,或者有些我们不想选择的元素也有相同的id.class属性值,怎么办呢? ...
- CSS选择器,层叠
CSS选择器 .class .intro 选择 class="intro" 的所有元素. 1 #id #firstname 选择 id="firstname" ...
- [css选择器]总结:IE6不支持的CSS选择符
转载地址:https://www.wenjiwu.com/doc/zvsbii.html.此文最后也给出了原文地址,但是我点击过去发现是什么赌博彩票的地址,360也弹出小心的提示,所以这里只给出了我转 ...
随机推荐
- 单麦克风AI降噪模块及解决方案
前记 随着以AI为核心的智能设备的广泛发展,语音这个非常重要的入口一直是很多厂商争夺的市场.作为音频采集的前端设备,能采集到的距离远,清晰度高,无噪声的信号是一个非常重要的能力.这样就对音频前端降 ...
- 5、Azure Devops之Azure Test Plans篇
1.什么是Azure Test Plans Azure Test Plans是提供给团队测试人员,管理测试计划.测试套件.测试用例的部件.管理测试计划.测试用例的定义,包括请求类型定义.参数定义,执行 ...
- 什么会导致JAVA应用程序的CPU使用率飙升
问题 无限循环的while会导致CPU使用率飙升吗? 经常使用Young GC会导致CPU占用率飙升吗? 具有大量线程的应用程序的CPU使用率是否较高? CPU使用率高的应用程序的线程数是多少? 处于 ...
- CAD和实时渲染之间的差距
建筑师如何将他们喜爱的CAD工具与虚幻引擎和Twinmotion 等快速实时渲染工具结合使用 每个建筑师都有自己喜欢的设计工具.从Revit的粉丝到阿奇卡德的狂热用户,AEC专业人员通常首选CAD和B ...
- (3)安装完python之后需要安装的Spyder集成开发环境教程
步骤一: 首先,在网站上下载你所需要的压缩文件,网址为https://files.pythonhosted.org/packages/5e/a0/ab7f29e32479d15663eab9afd1d ...
- drf(视图组件)
一. 前言 Django REST framwork 提供的视图的主要作用 1. 控制序列化器的执行(检验.保存.转换数据) 2. 控制数据库查询的执行 二. 两个视图基类 两个视图基类: APIVi ...
- CSS(语义化标签、多媒体标签、新表单元素、属性选择器、结构伪类选择器、伪元素选择器、盒子模型、滤镜、calc函数、过渡)
一.HTML5新特性 概述 HTML5 的新增特性主要是针对于以前的不足,增加了一些新的标签.新的表单和新的表单属性等. 这些新特性都有兼容性问题,基本是 IE9+ 以上版本的浏览器才支持,如果不考虑 ...
- 记录--你的网站如何接入QQ,微信登录
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 主要实现步骤 对接第三方平台,获取第三方平台的用户信息. 利用该用户信息,完成本应用的注册. qq登录接入 接入前的配置 qq互联 登录后 ...
- 记录--ECharts — 饼图相关功能点(内环、外环、环形间隔、环形文字、轮播动画)
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 记录一下在公司遇到的一些功能,以及相关实现 以上的内容我花了一周时间去实现的,自己也觉得时间很长,但主要因为很少使用ECharts,导致使 ...
- 使用Go语言开发一个短链接服务:五、添加和获取短链接
章节 使用Go语言开发一个短链接服务:一.基本原理 使用Go语言开发一个短链接服务:二.架构设计 使用Go语言开发一个短链接服务:三.项目目录结构设计 使用Go语言开发一个短链接服务:四.生成 ...