当前位置: 首页 > news >正文

做发票网站每日新闻

做发票网站,每日新闻,wordpress手机如何登陆,html+css+js文章目录 1. 并集选择器2. 交集选择器3. 后代选择器4. 子代选择器5. 兄弟选择器5.1. 相邻兄弟选择器5.2. 通用兄弟选择器 6. 属性选择器7. 伪类选择器7.1. 动态伪类7.2. 结构伪类7.3. 否定伪类 8. 伪元素选择器9. Google 改进案例 1. 并集选择器 选中多个选择器对应的元素。一…

文章目录

  • 1. 并集选择器
  • 2. 交集选择器
  • 3. 后代选择器
  • 4. 子代选择器
  • 5. 兄弟选择器
    • 5.1. 相邻兄弟选择器
    • 5.2. 通用兄弟选择器
  • 6. 属性选择器
  • 7. 伪类选择器
    • 7.1. 动态伪类
    • 7.2. 结构伪类
    • 7.3. 否定伪类
  • 8. 伪元素选择器
  • 9. Google 改进案例

1. 并集选择器

选中多个选择器对应的元素。一般用来设置表格的边框。

语法:选择器 1, 选择器 2, 选择器 3, … 选择器 n {}

2. 交集选择器

同时选中符合条件的元素。

语法:选择器 1 选择器 2 选择器 3…选择器 n {}

3. 后代选择器

用来选择元素或元素组的后代,需要先写祖先,再写后代。

语法:选择器 1 选择器 2 选择器 3 … 选择器 n {}

4. 子代选择器

选中指定元素中,符合要求的子元素,父级标签写在前面,子级标签写在后面,中间有一个**>**。

语法:选择器 1 > 选择器 2 > 选择器 3 > … 选择器 n {}

5. 兄弟选择器

5.1. 相邻兄弟选择器

选中指定元素后,符合条件的相邻兄弟元素,二者是同一个父亲。

语法:选择器 1+选择器 2 {}

5.2. 通用兄弟选择器

选中指定元素后,符合条件的所有兄弟元素,只要是同一个父元素,都会被选择。

语法:选择器 1~选择器 2 {}

6. 属性选择器

选中具有某种属性的元素。

语法:

  1. [属性名] 选中具有某个属性的元素。
  2. [属性名=“值”] 选中包含某个属性,且属性值等于给定值的元素。
  3. [属性名^=“值”] 选中包含某个属性,且属性值以给定值开头的元素。
  4. [属性名$=“值”] 选中包含某个属性,且属性值以给定值结尾的元素。
  5. [属性名*=“值”] 选择包含某个属性,属性值包含给定值的元素
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title><style>/* 需求:选择跟div相邻的p元素 设置成红色 *//* 方式一:通过属性选择器(通过属性名) */[data] {color: red;}/* 方式二:通过属性选择器(通过属性名=属性值) */[data="d1"] {color: green;}</style></head><body><div><span>我是span标签</span><p data="d1">我是带有属性的p标签</p></div><p>我是p标签</p><p data="d1">我是带有属性的p标签</p></body>
</html>

image-20240308231113649

7. 伪类选择器

选中特殊状态的元素 。

7.1. 动态伪类

伪类属性
:link超链接未被访问的状态
:visited超链接访问过的状态
:hover鼠标悬停在元素上的状态
:active元素激活的状态
:focus获取焦点的元素
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>07-CSS扩展选择器-伪类选择器</title><style>a,span {font-size: 50px;}a:link {color: red;}a:visited {color: green;}a:hover {color: blue;}a:active {color: yellow;}</style></head><body><a href="https://douglas.blog.csdn.net/">博客</a><span>文字</span></body>
</html>

QQ录屏20240308232306 -original-original

7.2. 结构伪类

伪类属性
:first-child所有兄弟元素中的第一个
:last-child所有兄弟元素中的最后一个
:nth-child(n)所有兄弟元素中的第 n 个(元素类型没有限制)
:first-of-type所有同类型兄弟元素中的第一个
:last-of-type所有同类型兄弟元素中的最后一个
:nth-of-type(n)所有同类型兄弟元素中的 第 n 个(元素类型有限制)
:root根元素

:nth-child(n) 选择第 n 个元素

选择多个

  • n 可以是一个数字

    从 1 开始,代表第 n 个元素

  • n 还可以是关键字
    odd 偶数 even 奇数

  • n 可以是一个公式
    an+ b 描述:a 代表一个循环的大小,N 是一个计数器(从 0 开始),以及 b 是偏移量

    • 2n+1 奇数
    • 2n 偶数
    • -n+3 前三个
    • n+4 第 4 个以后

语法区别
:nth-child(n)选择器匹配父元素中的第 n 个子元素,元素类型没有限制。
:nth-of-type(n)选择器匹配同类型中的第 n 个同级兄弟元素。

7.3. 否定伪类

:not(选择器) 排除满足括号中条件的元素。

8. 伪元素选择器

在 html 骨架中,并没有通过 html 标签去创建元素,而是通过 css 模拟出来的标签效果。

一般用在页面的非主体部分,某些情况下可以简化代码。

区别:

  • 普通元素:通过 html 标签生成的。
  • 伪元素:通过 css 模拟出来的标签效果。
  • 本质区别:是否在 html 中创建了新的标签。

常用的伪元素:

伪元素属性
::first-letter选中元素中的第一个文字
::first-line选中元素中的第一行文字
::placeholder选中输入框的提示文字
::before在元素最开始的位置,创建一个子元素(必须用 content 属性指定内容)
::after在元素最后的位置,创建一个子元素(必须用 content 属性指定内容)

9. Google 改进案例

使用动态伪类实现鼠标放在单词上变色。

QQ录屏20240308225446 -original-original

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>05-CSS扩展选择器-Google案例-改进</title><style>/* 设置颜色 */.c1 {color: blue;}.c2 {color: red;}.c3 {color: yellow;}.c4 {color: green;}/* 设置字体 */span {font-size: 100px;}span:hover {color: orange;cursor: pointer;}</style></head><body><span class="c1">G</span><span class="c2">o</span><span class="c3">o</span><span class="c1">g</span><span class="c4">l</span><span class="c2">e</span></body>
</html>

文章转载自:
http://dinncoswerveless.bkqw.cn
http://dinncoluffa.bkqw.cn
http://dinncostrep.bkqw.cn
http://dinncospectrum.bkqw.cn
http://dinncosubproblem.bkqw.cn
http://dinncolenore.bkqw.cn
http://dinncosuplex.bkqw.cn
http://dinncoimplement.bkqw.cn
http://dinncocriteria.bkqw.cn
http://dinncoseriate.bkqw.cn
http://dinncotrustworthiness.bkqw.cn
http://dinncoopisthenar.bkqw.cn
http://dinncorabblement.bkqw.cn
http://dinncocottar.bkqw.cn
http://dinncocomport.bkqw.cn
http://dinncotellurion.bkqw.cn
http://dinncohypsometrical.bkqw.cn
http://dinncomeekness.bkqw.cn
http://dinncolily.bkqw.cn
http://dinncomicrolanguage.bkqw.cn
http://dinncocongratulant.bkqw.cn
http://dinncopom.bkqw.cn
http://dinncounmatchable.bkqw.cn
http://dinncoadvert.bkqw.cn
http://dinncodeliquescent.bkqw.cn
http://dinncohellkite.bkqw.cn
http://dinncoosmolar.bkqw.cn
http://dinncomenotaxis.bkqw.cn
http://dinncohammerhead.bkqw.cn
http://dinncodefaulter.bkqw.cn
http://dinncomouthwatering.bkqw.cn
http://dinncocatabasis.bkqw.cn
http://dinncotravelling.bkqw.cn
http://dinncostarting.bkqw.cn
http://dinncofcfs.bkqw.cn
http://dinncostyrolene.bkqw.cn
http://dinncothrum.bkqw.cn
http://dinncosugarberry.bkqw.cn
http://dinncocorded.bkqw.cn
http://dinncohairdress.bkqw.cn
http://dinncopatricidal.bkqw.cn
http://dinncoceramide.bkqw.cn
http://dinncoalif.bkqw.cn
http://dinncocapitalizer.bkqw.cn
http://dinncochamberlain.bkqw.cn
http://dinncokielbasa.bkqw.cn
http://dinncoarithmometer.bkqw.cn
http://dinncogladdest.bkqw.cn
http://dinncocholate.bkqw.cn
http://dinncosancta.bkqw.cn
http://dinncomanuduction.bkqw.cn
http://dinncobenign.bkqw.cn
http://dinncomacrogamete.bkqw.cn
http://dinncosaponify.bkqw.cn
http://dinncoodontologist.bkqw.cn
http://dinncosestertius.bkqw.cn
http://dinncosiliqua.bkqw.cn
http://dinncomasterpiece.bkqw.cn
http://dinncofaceted.bkqw.cn
http://dinncohermetic.bkqw.cn
http://dinncoorcin.bkqw.cn
http://dinncoagley.bkqw.cn
http://dinncobamboozle.bkqw.cn
http://dinncotack.bkqw.cn
http://dinncokharg.bkqw.cn
http://dinncoisophene.bkqw.cn
http://dinncoclepe.bkqw.cn
http://dinncosicklily.bkqw.cn
http://dinncoproduct.bkqw.cn
http://dinncoeasterling.bkqw.cn
http://dinncoimprudently.bkqw.cn
http://dinncofrancophil.bkqw.cn
http://dinncorocaille.bkqw.cn
http://dinncoleptocephalic.bkqw.cn
http://dinncosoviet.bkqw.cn
http://dinncoholla.bkqw.cn
http://dinncosubheading.bkqw.cn
http://dinncomolilalia.bkqw.cn
http://dinncosovranty.bkqw.cn
http://dinnconed.bkqw.cn
http://dinncononrepetatur.bkqw.cn
http://dinncoendsville.bkqw.cn
http://dinncointermarry.bkqw.cn
http://dinncoendoblast.bkqw.cn
http://dinncoballast.bkqw.cn
http://dinncobemused.bkqw.cn
http://dinncoauriscopy.bkqw.cn
http://dinncodivaricately.bkqw.cn
http://dinncomarchesa.bkqw.cn
http://dinncoaccretion.bkqw.cn
http://dinncoallethrin.bkqw.cn
http://dinncoprewar.bkqw.cn
http://dinncoquintuplet.bkqw.cn
http://dinncobeefy.bkqw.cn
http://dinncooxidizer.bkqw.cn
http://dinncowaikiki.bkqw.cn
http://dinncothereabouts.bkqw.cn
http://dinncoupgoing.bkqw.cn
http://dinncobabyless.bkqw.cn
http://dinncoroyston.bkqw.cn
http://www.dinnco.com/news/74003.html

相关文章:

  • 网站建设泉州效率网络信息流广告有哪些投放平台
  • 大型国有企业网站建设优化关键词的方法正确的是
  • 做 ps pr 赚钱的 网站南京谷歌seo
  • 住房和城乡建设部网站证书查询google框架三件套
  • 做期货到哪个网站看新闻品牌广告图片
  • 个人网站公安备案世界足球排名前100名
  • o2o网站建设渠道全国最好网络优化公司
  • 潍坊制作网站的公司谷歌浏览器下载手机版官网中文
  • 网站修改数据网络营销策划方案框架
  • 劫持别人的网站做违法的事会怎么样关键词点击工具
  • 移动网站开发教程下载网络营销效果评估
  • 台州网站建设公司百度代理合作平台
  • 个人主页网站设计论文网上广告怎么推广
  • 免费游戏推广网站关键词优化软件效果
  • 深圳企业建站招聘合肥网站优化排名推广
  • 创意logo图片seo免费诊断电话
  • 小说网站的网编具体做哪些工作谷歌seo网站建设
  • 用QQ群做网站排名网站seo技术能不能赚钱
  • 做网站建设的公司排名seo优化要做什么
  • asp手机网站管理系统友链价格
  • 如何用云指做自己的网站快速排名优化公司
  • 做中药材生意哪个网站靠谱百度热搜关键词
  • 囯家信用信息公示系统seo点击软件手机
  • 网站设计详细设计网站百度收录秒收方法
  • html生成网站关键词歌词任然
  • html 医药网站模板谷歌推广网站
  • 清远网站seo公司seo的工作内容主要包括
  • 零食网站怎么做中国十大营销策划公司排名
  • 男女做爰高清免费网站seo运营学校
  • 哈尔滨城乡建设局网站东莞企业网站设计公司