1

id选择器和类选择器

 1 year ago
source link: https://blog.51cto.com/u_15858801/5860938
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

id选择器和类选择器

精选 原创

wx63624cd34f833 2022-11-17 17:43:24 博主文章分类:前端 ©著作权

文章标签 类选择器 id选择器 文章分类 Html/CSS 前端开发 阅读数207

类选择器:

类命名规则:

样式点定义,结构类(class)调用,一个或多个,开发最常用。

各个类名中间用空格隔开。

id选择器:样式#,结构是id,只能调用一次,别人切勿使用。

id选择器和类选择器_类选择器
id选择器和类选择器_类选择器_02

这张图片的写法是错误的:

id选择器只能调用一次。

id选择器和类选择器_id选择器_03

id选择器和类选择器的不同之处在于:

1.id选择器相当于人的身份证号码,而类选择器相当于人的姓名,姓名可以重复,身份证号码全国唯一。

下边的写法是正确的:

id选择器和类选择器_id选择器_04

标注:font-size 是调整字体大小的。

  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK