:last-child----represents the last element among a group of sibling elements.
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.的更多相关文章
- CSS 选择器 :last-child与:last-of-type的区别
:last-child----represents the last element among a group of sibling elements. CSS伪类 :last-child 代表在一 ...
- Ext JS学习第十三天 Ext基础之 Ext.Element
•Ext.Element提供了181个方法,嗯,还没完,只是在4.1版本中是这样,最新的4.2版本貌似又增加了新方法,可谓是相当丰富给力.那么根据操作类型基本可以分为查询系.DOM操作系.样式操作系. ...
- ExtJS得知--------Ext.Element学习的查询方法(示例)
详细实例:(实验结果可复制代码后进行演示) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{//创建一个面板 title:'我的面板' , ...
- Vue框架Element的事件传递broadcast和dispatch方法分析
前言 最近在学习饿了么的Vue前端框架Element,发现其源码中大量使用了$broadcast和$dispatch方法,而Element使用的是Vue2.0版本,众所周知在Vue 1.0升级到2.0 ...
- [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 ...
- 【RF库XML测试】Get Element
Name:Get ElementSource:XML <test library>Arguments:[ source | xpath=. ]Returns an element in t ...
- EventTarge Node Docuement Element HTMLElement 关系
综述: 可以将其看做是依次继承的关系: Node Node A Node is an interface from which a number of DOM types inherit, and a ...
- Kth Smallest Element in a BST 解答
Question Given a binary search tree, write a function kthSmallest to find the kth smallest element i ...
- Kth Smallest Element in Unsorted Array
(referrence: GeeksforGeeks, Kth Largest Element in Array) This is a common algorithm problem appeari ...
随机推荐
- Octavia 创建 loadbalancer 的实现与分析
目录 文章目录 目录 从 Octavia API 看起 Octavia Controller Worker database_tasks.MapLoadbalancerToAmphora comput ...
- pyinstaller-python->exe
pip install pyinstaller. pyinstaller -F /home/base64_decode.py https://www.imooc.com/article/26772 h ...
- python 封装dlib模型进行人脸识别系统的登录认证
1.直接上干货 #!/usr/bin/python # -*- coding: utf-8 -*- import time import dlib import numpy as np class f ...
- liteide使用中的注意点
liteide使用中的注意点 无法跳转 会出现无法跳转的情况,可能是这个包里面的某个文件会有错误,一般把这个包里的所有的错误都改正之后就能正常跳转了.Ubuntu中,直接按f2可以跳入,之后按住alt ...
- .net core 学习小结之 Cookie-based认证
在startup中添加授权相关的管道 using System; using System.Collections.Generic; using System.Linq; using System.T ...
- 利用sshpass批量导入ssh-key
#!/bin/bash set +x base_dir=$(pwd) ip_list='10.200.7.28,10.200.7.29,10.200.7.30,10.200.7.31' USER='r ...
- c++ 十进制、十六进制和BCD的相互转换
#include <stdio.h> #include <string.h> #include <iostream> using namespace std; // ...
- Linux文件拷贝(6)
本篇介绍文件拷贝操作,主要讲两个命令: 命令 对应英文 作用 tree[目录名] tree 以树状图列出文件目录结构 cp 源文件 目标文件 copy 复制文件或者目录 tree tree命令可以将一 ...
- linux中文件属性
一. linux系统如何管理文件 1.1. 硬盘中的静态文件和inode a. 文件平时都在存放在硬盘中的,硬盘中存储的文件以一种固定的形式存放的,我们叫静态文件. b. 一块硬盘中可以分为两大区域: ...
- 2019-8-31-MobaXterm-使用代理
title author date CreateTime categories MobaXterm 使用代理 lindexi 2019-08-31 16:55:58 +0800 2018-02-13 ...