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. ES6标准入门 第五章:数值的扩展

    1.二进制和八进制数值表示法 二进制前缀:0b(或0B):   八进制前缀:0o(或0O). 注意:ES5的严格模式 和 ES6中不再允许使用 0  表示八进制. 将二进制和八进制数值转换为十进制数值 ...

  2. Vue模版编译

    一 模版文件 <div> <header> <h1>I'm a template!</h1> </header> <p v-if=&q ...

  3. 一图看懂python对excel的读写

  4. 手工设计神经MNIST使分类精度达到98%以上

    设计了两个隐藏层,激活函数是tanh,使用Adam优化算法,学习率随着epoch的增大而调低 import tensorflow as tf from tensorflow.examples.tuto ...

  5. 各种开源许可 license 区别

    copy from http://www.ruanyifeng.com/blog/2011/05/how_to_choose_free_software_licenses.html

  6. @Scheduled(cron = "0/5 * * * * *")将时间改为配置

    有两种方法:第一种当然你可以把Scheduled写到xml文件中进行配置. 第二种在你的类前面添加 此处讲解第二种写法 第二种在你的类前面添加@PropertySource("classpa ...

  7. Simplify Path(路径简化)

    问题: 来源:https://leetcode.com/problems/simplify-path Given an absolute path for a file (Unix-style), s ...

  8. java中时间与时间戳的相互转换

    package com.test.one; import java.text.ParseException; import java.text.SimpleDateFormat; import jav ...

  9. Element-ui 使用详细介绍

    一.后台搭建 使用 vue-admin-template 来快速搭建后台管理,它包含了 Element UI & axios & iconfont & permission c ...

  10. 如何通过PHP将excel的数据导入MySQL中

    在开发PHP程序时,很多时候我们会有将数据批量导入数据库的需求,如学生信息批量添加到数据库中,而事先用excel编排好,对excel实行操作,便是我们比较常用的选择方式. 在对excel的操作中,ph ...