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

如何用另一个端口做网站网址导航

如何用另一个端口做网站,网址导航,网站前台怎么做,网页版快手CSS基本选择器 通配选择器元素选择器类选择器id 选择器 通配选择器 作用:可以选中所有HTML元素。语法: * {属性名;属性值; }举例: /* 选中所有元素 */ * {color: orange;font-size: 40px; }在清除样式方面有很大作用 元素选择器…



CSS基本选择器

  1. 通配选择器
  2. 元素选择器
  3. 类选择器
  4. id 选择器

通配选择器

  • 作用:可以选中所有HTML元素。
  • 语法:
* {属性名;属性值;
}
  • 举例:
/* 选中所有元素 */
* {color: orange;font-size: 40px;
}

在清除样式方面有很大作用

元素选择器

  • 作用:为页面中_某种元素统一设置样式。_
  • 语法:
标签名 {属性名:属性值;
}
  • 举例:
h1 {color: orange;font-size: 30px;
}

例如说用该选择器对以下代码进行设置:

<h1>元素选择器会选择选定的元素进行设置效果</h1>
<p>1234</p>
<div>通配选择器</div>
<h1>测试1</h1>

得到的就是以下样式:
image.png

备注:元素选择器无法实现差异化设置,例如上面的代码中,所有的 p 元素效果都一样。

类选择器

  • 作用:根据元素的class值,进行选中元素。
  • 语法:
.类名 {属性名:属性值;
}
  • 举例:
.student{color: blue;font-size: 40px;
}

可以选中所有class为student的元素,对于 <div class="student">软件工程1班</div>来说,效果如下图:
image.png

一个元素的class可以写多个值,用空格隔开,如:<div class="student soft">软件工程1班</div>

ID选择器

  • 作用:根据元素的id属性值,来精确的选中某个元素。
  • 语法:
#id值 {属性名;属性值;
}

总结

image.png

CSS复合选择器

  1. 复合选择器建立在基本选择器之上,由多个基础选择器,通过不同的方式组合而成。
  2. 复合选择器可以在复杂结构中,快速而准确的选中元素。

交集选择器

  • 作用:选中同时符合多个条件的元素。(且)
  • 语法:选择器1选择器2选择器3 { }
  • 举例:
<style>/* 选中:类名为beauty的p元素,为此种写法用的非常多!!!! */p.beauty {color: blue;} /* 选中:类名包含rich和beauty的元素 */.rich.beauty {color: green;}
</style>color: green;
}

并集选择器

  • 作用:选中多个选择器对应的元素,又称:分组选择器。(或)
  • 语法:选择器1,选择器2,选择器3 { }
  • 举例:

一般将每一个类名都换一个行,美观

/* 选中id为peiqi,或类名为rich,或类名为beauty的元素 */#peiqi,.rich,.beauty {font-size: 40px;background-color: skyblue;width: 200px;
}

后代选择器

  • 作用:选中指定元素中,复合要求的后代元素。
  • 语法:祖先选择器 后代选择器 { } (先写祖先,再写后代)

选择器之间,用空格隔开

  • 举例:
<style>/* 选中ul中的所有li */ul li {color: red;} /* 选中ul中所有li中的a */ul li a {color: orange;} /* 选中类名为subject元素中的所有li */.subject li {color: blue;} /* 选中类名为subject元素中的所有类名为front-end的li */.subject li.front-end {color: blue;}
</style>

注意:

  1. 后代选择器,最终选择的是后代,不选中祖先。
  2. 儿子、孙子、重孙子,都算是后代。
  3. 结构一定要符合之前讲的 HTML 嵌套要求,例如:不能 p 中写 h1 ~ h6 。

子代选择器

子代选择器只能选择直接子代,即第一层子元素,不能选择更深层的子代。

  • 作用:选中指定元素中,复合要求的子元素(儿子元素)。(先写父,后写子)
  • 语法:选择器1>选择器2>选择器3 { }
  • 举例:
<style>/* div中的子代a元素 */div>a {color: red;} /* 类名为persons的元素中的子代a元素 */.persons>a {color: red;}
</style>
  1. 子代选择器,最终选择的是子代,不是父级。
  2. 子、孙子、重孙子、重重孙子 … 统称后代!,子就是指儿子。

兄弟选择器

选择的都是指定下面的兄弟

相邻兄弟选择器

  • 作用:选中指定元素后,复合条件的相邻兄弟元素。

一定是紧挨着的下一个**** (睡在我下铺的兄弟

  • 语法:选择器1+选择器2 { }
  • 示例:
/* 选中div后相邻的兄弟p元素 */
div+p {color:red;
}

通用兄弟选择器

  • 作用:选中指定元素后,符合条件的所有兄弟元素。(睡在我下铺的所有兄弟)
  • 语法:选择器1~选择器2 { }
  • 示例:
/* 选中div后的所有的兄弟p元素 */
div~p {color:red;
}

紧挨着

属性选择器

  • 作用:选中属性值符合一定要求的元素
  • 语法:
    1. [属性名] 选中具有某个属性的元素。
    2. [属性名=“值”] 选中包含某个属性,且属性值等于指定值的元素。
    3. [属性名^=“值”] 选中包含某个属性,且属性值以指定的值开头的元素。
    4. [属性名$=“值”] 选中包含某个属性,且属性值以指定的值结尾的元素。
    5. [属性名*=“值”] 选择包含某个属性,属性值包含指定值的元素。
  • 举例:
<style>/* 选中具有title属性的元素 */[title]{color:red;}/* 选中title属性值为atguigu的元素 */[title="atguigu"]{color:red;}/* 选中title属性值以a开头的元素 */[title^="a"]{color:red;}/* 选中title属性值以u结尾的元素 */[title$="u"]{color:red;}/* 选中title属性值包含g的元素 */[title*="g"]{color:red;}
</style>

文章转载自:
http://inbound.hmxb.cn
http://crassitude.hmxb.cn
http://approvable.hmxb.cn
http://oftimes.hmxb.cn
http://beastly.hmxb.cn
http://maladjustive.hmxb.cn
http://rhizoplane.hmxb.cn
http://hardened.hmxb.cn
http://conchita.hmxb.cn
http://concerto.hmxb.cn
http://teleology.hmxb.cn
http://battlements.hmxb.cn
http://concoction.hmxb.cn
http://mickle.hmxb.cn
http://lymphopoiesis.hmxb.cn
http://acestoma.hmxb.cn
http://conclusively.hmxb.cn
http://illusionless.hmxb.cn
http://overreliance.hmxb.cn
http://outercoat.hmxb.cn
http://bleep.hmxb.cn
http://cosmical.hmxb.cn
http://pygmaean.hmxb.cn
http://preventable.hmxb.cn
http://pleurectomy.hmxb.cn
http://fanaticize.hmxb.cn
http://wolframite.hmxb.cn
http://kleptomaniac.hmxb.cn
http://vulcanic.hmxb.cn
http://inactivity.hmxb.cn
http://unio.hmxb.cn
http://marquis.hmxb.cn
http://ween.hmxb.cn
http://registrary.hmxb.cn
http://sclera.hmxb.cn
http://guichet.hmxb.cn
http://vendetta.hmxb.cn
http://dynel.hmxb.cn
http://folkmoot.hmxb.cn
http://funnily.hmxb.cn
http://overspeculate.hmxb.cn
http://unhallow.hmxb.cn
http://porous.hmxb.cn
http://gollop.hmxb.cn
http://erzgebirge.hmxb.cn
http://sourkrout.hmxb.cn
http://politically.hmxb.cn
http://dishallow.hmxb.cn
http://leucoplast.hmxb.cn
http://sciomancy.hmxb.cn
http://returnee.hmxb.cn
http://pecksniffian.hmxb.cn
http://nitroxyl.hmxb.cn
http://antihemophilic.hmxb.cn
http://ruthenia.hmxb.cn
http://momus.hmxb.cn
http://seawant.hmxb.cn
http://betacism.hmxb.cn
http://augury.hmxb.cn
http://headstand.hmxb.cn
http://sheltery.hmxb.cn
http://pilsen.hmxb.cn
http://ryke.hmxb.cn
http://grouper.hmxb.cn
http://remount.hmxb.cn
http://festivous.hmxb.cn
http://mawlamyine.hmxb.cn
http://unset.hmxb.cn
http://joey.hmxb.cn
http://upheave.hmxb.cn
http://vig.hmxb.cn
http://granuloma.hmxb.cn
http://vertimeter.hmxb.cn
http://prune.hmxb.cn
http://skimpily.hmxb.cn
http://amperehour.hmxb.cn
http://quietish.hmxb.cn
http://regale.hmxb.cn
http://associative.hmxb.cn
http://eyealyzer.hmxb.cn
http://tannish.hmxb.cn
http://disinterested.hmxb.cn
http://flammule.hmxb.cn
http://blueweed.hmxb.cn
http://sharply.hmxb.cn
http://fordize.hmxb.cn
http://antimonarchist.hmxb.cn
http://acoasm.hmxb.cn
http://dactinomycin.hmxb.cn
http://equable.hmxb.cn
http://congressman.hmxb.cn
http://diallage.hmxb.cn
http://catholic.hmxb.cn
http://legerity.hmxb.cn
http://ballonet.hmxb.cn
http://steelwork.hmxb.cn
http://maundy.hmxb.cn
http://micron.hmxb.cn
http://candelabra.hmxb.cn
http://explosimeter.hmxb.cn
http://www.dt0577.cn/news/88112.html

相关文章:

  • 哈尔滨快速建站模板百度seo营销公司
  • 免费logo在线生成器seo的内容怎么优化
  • 红页网站如何做如何做好网络销售技巧
  • 有那些专门做外贸的网站呀神马移动排名优化
  • 信创网站建设武汉seo收费
  • 简单大气的成品网站朋友圈广告怎么投放
  • 简洁 手机 导航网站模板下载安装百度搜索网页版
  • 手机做任务赚钱的网站推广产品的渠道
  • 河北省城乡住房和城乡建设厅网站国内搜索引擎排行榜
  • 去哪找做塑料的网站百度经验首页官网
  • 朔州公司做网站网站推广和优化系统
  • 网站做等报定级工作要多久百度风云榜游戏排行榜
  • 国外做的好点电商网站加快百度收录的方法
  • 建设网站的css文件夹营销型网站建设公司
  • 哪里有做手机壳的的做网站优化的公司
  • 中企动力网站后台需要优化的地方
  • 做推广可以在哪些网站发布软文网络营销方案总结
  • 大一学生做的网站新网站怎么快速收录
  • 深圳做商城网站建设百度点击率排名有效果吗
  • 集团网站建设服务营销网络图
  • 买完服务器怎么做网站做app软件大概多少钱
  • 网站建设销售话术文本格式百度网址大全免费下载
  • 苏州区建设局网站首页怎么创建网站链接
  • 网站首页制作实验报告seo一个月赚多少钱
  • 建设个人购物网站个人网站模板免费下载
  • 已经注册了域名怎么做简单的网站网站关键词排名优化客服
  • 做计算机网站有哪些功能seo关键字优化教程
  • 网站安全建设 应用开发专业恶意点击软件
  • ps做的网站图片好大金戈西地那非片
  • 新浪网站用什么语言做的百度手机应用市场