CSS伪类 :last-child 代表在一群兄弟元素中的最后一个元素。

  • 从代码和图可以看出:last-child选择了最后一个li标签。

    同时,我们换另外一段代码,看看是否还有这样的效果。

    • 从代码和图可以看出,:last-child并没有起到我们想要的作用。如果,这个时候去掉最后的div标签,再看看效果。

    • 这时,效果出来了,那么,可以总结了。

      :last-child表示其父元素的最后一个子元素,且这个元素是css指定的元素,才可以生效。

      :last-of-type

       
      • 关于:last-of-type手册中是这么解释的:

        The :last-of-type CSS pseudo-class represents the last element of its type among a group of sibling elements.

        CSS伪类:last-of-type代表在一群兄弟元素中的最后一个指定类型的元素。

        直接用上面两个栗子。

        没有干扰元素,OK。

      • 有干扰元素,OK。

      • :last-of-type表示其父元素下的最后一个指定类型的元素

:last-child----represents the last element among a group of sibling elements.的更多相关文章

  1. CSS 选择器 :last-child与:last-of-type的区别

    :last-child----represents the last element among a group of sibling elements. CSS伪类 :last-child 代表在一 ...

  2. Ext JS学习第十三天 Ext基础之 Ext.Element

    •Ext.Element提供了181个方法,嗯,还没完,只是在4.1版本中是这样,最新的4.2版本貌似又增加了新方法,可谓是相当丰富给力.那么根据操作类型基本可以分为查询系.DOM操作系.样式操作系. ...

  3. ExtJS得知--------Ext.Element学习的查询方法(示例)

    详细实例:(实验结果可复制代码后进行演示) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{//创建一个面板 title:'我的面板' , ...

  4. Vue框架Element的事件传递broadcast和dispatch方法分析

    前言 最近在学习饿了么的Vue前端框架Element,发现其源码中大量使用了$broadcast和$dispatch方法,而Element使用的是Vue2.0版本,众所周知在Vue 1.0升级到2.0 ...

  5. [Swift]LeetCode703. 数据流中的第K大元素 | Kth Largest Element in a Stream

    Design a class to find the kth largest element in a stream. Note that it is the kth largest element ...

  6. 【RF库XML测试】Get Element

    Name:Get ElementSource:XML <test library>Arguments:[ source | xpath=. ]Returns an element in t ...

  7. EventTarge Node Docuement Element HTMLElement 关系

    综述: 可以将其看做是依次继承的关系: Node Node A Node is an interface from which a number of DOM types inherit, and a ...

  8. Kth Smallest Element in a BST 解答

    Question Given a binary search tree, write a function kthSmallest to find the kth smallest element i ...

  9. Kth Smallest Element in Unsorted Array

    (referrence: GeeksforGeeks, Kth Largest Element in Array) This is a common algorithm problem appeari ...

随机推荐

  1. node_modules .bin文件夹下的文件

    node_modues/.bin文件夹下,对于一个npm包,有两个可执行文件,没有后缀名的是是对应unix系的shell脚本,.cmd文件对应的是windows bat脚本,内容都是用node执行一个 ...

  2. Monkey测试:日志信息分析

    在跑monkey时,我们需要将日志输出到文件,然后对日志信息进行分析. 一.输出日志到文件 在monkey命令后加>文件地址 如:adb shell monkey 1000>E:/text ...

  3. Selenium学习之==>Xpath使用方法

    一.什么是Xpath XPath是XML的路径语言,通俗一点讲就是通过元素的路径来查找到这个标签元素. 工具 Xpath的练习建议大家安装火狐浏览器后,下载插件,FireBug.由于最新版火狐不再支持 ...

  4. win7自带录像工具怎么打开?win7自带录像工具的使用方法

    http://www.xitongcheng.com/jiaocheng/win7_article_28327.html 制作教程的好帮手 win7自带录像工具怎么打开?win7自带录像工具的使用方法 ...

  5. is_enabled()检查元素是否可以编辑 如文本框

    演示代码from selenium import webdriverdriver = webdriver.Firefox()driver.get("https://www.baidu.com ...

  6. pymysql操作数据库

    pymysql.connect()参数说明:(连接数据库时需要添加的参数)host(str): MySQL服务器地址port(int): MySQL服务器端口号user(str): 用户名passwd ...

  7. Chapter02 第三节 其他语句

    2.3 其他语句 // getinfo.cpp #include <bits/stdc++.h> using namespace std; int main() { int carrots ...

  8. 华南理工大学 “三七互娱杯” C HRY and Abaas

    https://ac.nowcoder.com/acm/contest/874/C 题目大意是两人俄罗斯轮盘赌 n个位置 有m个子弹 已知哪些位置上有子弹 子弹打出 游戏结束 求第i次扣动扳机游戏才结 ...

  9. 【Linux 环境搭建】ubuntu 的samba配置

    在/etc/samba/smb.conf的文件末尾增加下面的内容然后重启samba [home] comment = James Harden path = / browseable = yes wr ...

  10. java8--- Predicate 意义 代码

    //为了去除 DiyInterface 这个函数式接口,可以用通用函数式接口 Predicate 替代如下: https://blog.csdn.net/u011848397/article/deta ...