css3-2 CSS3选择器和文本字体样式

css3-2   CSS3选择器和文本字体样式

一、总结

一句话总结:是要记下来的,记下来可以省很多事。

 

1、css的基本选择器中的:first-letter和:first-line是什么意思?

:first-letter选择第一个单词,:first-line选择第一行

 

2、css的伪类选择器有哪三种,分别是什么意思?

伪类选择器:
:hover
:focus
::selection   所选的东西,比如文字

 

3、css字体设置4剑客是哪四个?

1.font-family 字体类型
2.font-size   字体大小
3.font-style  字体样式
4.font-weight 字体粗细

 

4、css中文本块设置,必加的两个属性是什么?

overflow设置超出部分滚动条,wordbreak设置横向wordbreak

15             overflow:auto; 16  word-break:break-all;

 

5、css的伪类选择器中的p::selection是什么意思?

所选文字

11         p::selection{
12             background: #f00; 13 }

 

二、CSS3选择器和文本字体样式

1、相关知识

css选择器:
• 常用选择器
• 基本选择器
• 层级选择器
• 伪类选择器
• 属性选择器

常用选择器:
1.标签
2.id
3.类
4.关联
5.组合

基本选择器:
• :first-child
• :first-letter
• :first-line
• :last-child
• :nth-child(2)

层级选择器:
• a b
• a>b
• a+b

伪类选择器:
:hover
:focus
::selection

属性选择器:
• [id]
• [id=use1]
• [name*=us]
• [name^=en]
• [name$=en]

常见的样式属性和值:
1.字体与颜色
2.背景属性
3.文本属性
4.边框属性
5.鼠标光标属性
6.列表样式
7.定位属性
8.内外边距
9.浮动和清除浮动
10.滚动条
11.显示和隐藏

字体:
1.font-family 字体类型
2.font-size   字体大小
3.font-style  字体样式
4.font-weight 字体粗细

文本:
1.letter-spacing   字间距
2.word-spacing     词间距
3.text-decoration  下划线
4.text-align       对齐
5.text-indent      缩进
6.line-height      行高
7.color            颜色
8.word-break       折行

 

2、代码

word-break文字折行

 1 <!doctype html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>index</title>
 6     <style>
 7         *{
 8             font-family:微软雅黑;
 9         }
10         
11         div{
12             width:500px;
13             height:100px;
14             border:2px solid #f00;
15             overflow:auto;
16             word-break:break-all;
17         }
18     </style>
19 </head>
20 <body>
21     <div>
22         <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
23     </div>
24 </body>
25 </html>

selection伪类选择器

 1 <!doctype html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>index</title>
 6     <style>
 7         *{
 8             font-family: 微软雅黑;
 9         }
10         
11         p::selection{
12             background: #f00;
13         }
14     </style>
15 </head>
16 <body>
17     <h2>linux技术</h2>    
18     <p>linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!linux is very much!</p> </body>
19 </html>

 

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/Renyi-Fan/p/9208734.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389424.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mongodb仲裁者_真理的仲裁者

mongodb仲裁者Coming out of college with a background in mathematics, I fell upward into the rapidly growing field of data analytics. It wasn’t until years later that I realized the incredible power that comes with the position. As Uncle Ben told Peter Par…

优化 回归_使用回归优化产品价格

优化 回归应用数据科学 (Applied data science) Price and quantity are two fundamental measures that determine the bottom line of every business, and setting the right price is one of the most important decisions a company can make. Under-pricing hurts the co…

Node.js——异步上传文件

前台代码 submit() {var file this.$refs.fileUpload.files[0];var formData new FormData();formData.append("file", file);formData.append("username", this.username);formData.append("password", this.password);axios.post("http…

用 JavaScript 的方式理解递归

原文地址 1. 递归是啥? 递归概念很简单&#xff0c;“自己调用自己”&#xff08;下面以函数为例&#xff09;。 在分析递归之前&#xff0c;需要了解下 JavaScript 中“压栈”&#xff08;call stack&#xff09; 概念。 2. 压栈与出栈 栈是什么&#xff1f;可以理解是在内存…

PyTorch官方教程中文版:Pytorch之图像篇

微调基于 torchvision 0.3的目标检测模型 """ 为数据集编写类 """ import os import numpy as np import torch from PIL import Imageclass PennFudanDataset(object):def __init__(self, root, transforms):self.root rootself.transforms …

大数据数据科学家常用面试题_进行数据科学工作面试

大数据数据科学家常用面试题During my time as a Data Scientist, I had the chance to interview my fair share of candidates for data-related roles. While doing this, I started noticing a pattern: some kinds of (simple) mistakes were overwhelmingly frequent amo…

scrapy模拟模拟点击_模拟大流行

scrapy模拟模拟点击复杂系统 (Complex Systems) In our daily life, we encounter many complex systems where individuals are interacting with each other such as the stock market or rush hour traffic. Finding appropriate models for these complex systems may give…

公司想申请网易企业电子邮箱,怎么样?

不论公司属于哪个行业&#xff0c;选择企业邮箱&#xff0c;交互界面友好度、稳定性、安全性都是选择邮箱所必须考虑的因素。网易企业邮箱邮箱方面已有21年的运营经验&#xff0c;是国内资历最高的电子邮箱&#xff0c;在各个方面都非常成熟完善。 从交互界面友好度来看&#x…

莫烦Matplotlib可视化第二章基本使用代码学习

基本用法 import matplotlib.pyplot as plt import numpy as np""" 2.1基本用法 """ # x np.linspace(-1,1,50) #[-1,1]50个点 # #y 2*x 1 # # y x**2 # plt.plot(x,y) #注意&#xff1a;x,y顺序不能反 # plt.show()"""…

vue.js python_使用Python和Vue.js自动化报告过程

vue.js pythonIf your organization does not have a data visualization solution like Tableau or PowerBI nor means to host a server to deploy open source solutions like Dash then you are probably stuck doing reports with Excel or exporting your notebooks.如果…

plsql中导入csvs_在命令行中使用sql分析csvs

plsql中导入csvsIf you are familiar with coding in SQL, there is a strong chance you do it in PgAdmin, MySQL, BigQuery, SQL Server, etc. But there are times you just want to use your SQL skills for quick analysis on a small/medium sized dataset.如果您熟悉SQ…

第十八篇 Linux环境下常用软件安装和使用指南

提醒&#xff1a;如果之后要安装virtualenvwrapper的话&#xff0c;可以直接跳到安装virtualenvwrapper的方法&#xff0c;而不需要先安装好virtualenv安装virtualenv和生成虚拟环境安装virtualenv&#xff1a;yum -y install python-virtualenv生成虚拟环境&#xff1a;先切换…

莫烦Matplotlib可视化第三章画图种类代码学习

3.1散点图 import matplotlib.pyplot as plt import numpy as npn 1024 X np.random.normal(0,1,n) Y np.random.normal(0,1,n) T np.arctan2(Y,X) #用于计算颜色plt.scatter(X,Y,s75,cT,alpha0.5)#alpha是透明度 #plt.scatter(np.arange(5),np.arange(5)) #一条线的散点…

计算机科学必读书籍_5篇关于数据科学家的产品分类必读文章

计算机科学必读书籍Product categorization/product classification is the organization of products into their respective departments or categories. As well, a large part of the process is the design of the product taxonomy as a whole.产品分类/产品分类是将产品…

es6解决回调地狱问题

本文摘抄自阮一峰老师的 http://es6.ruanyifeng.com/#docs/generator-async 异步 所谓"异步"&#xff0c;简单说就是一个任务不是连续完成的&#xff0c;可以理解成该任务被人为分成两段&#xff0c;先执行第一段&#xff0c;然后转而执行其他任务&#xff0c;等做好…

交替最小二乘矩阵分解_使用交替最小二乘矩阵分解与pyspark建立推荐系统

交替最小二乘矩阵分解pyspark上的动手推荐系统 (Hands-on recommender system on pyspark) Recommender System is an information filtering tool that seeks to predict which product a user will like, and based on that, recommends a few products to the users. For ex…

莫烦Matplotlib可视化第四章多图合并显示代码学习

4.1Subplot多合一显示 import matplotlib.pyplot as plt import numpy as npplt.figure() """ 每个图占一个位置 """ # plt.subplot(2,2,1) #将画板分成两行两列&#xff0c;选取第一个位置,可以去掉逗号 # plt.plot([0,1],[0,1]) # # plt.su…

python 网页编程_通过Python编程检索网页

python 网页编程The internet and the World Wide Web (WWW), is probably the most prominent source of information today. Most of that information is retrievable through HTTP. HTTP was invented originally to share pages of hypertext (hence the name Hypertext T…

Python+Selenium自动化篇-5-获取页面信息

1.获取页面title title&#xff1a;获取当前页面的标题显示的字段from selenium import webdriver import time browser webdriver.Chrome() browser.get(https://www.baidu.com) #打印网页标题 print(browser.title) #输出内容&#xff1a;百度一下&#xff0c;你就知道 2.…

火种 ctf_分析我的火种数据

火种 ctfOriginally published at https://www.linkedin.com on March 27, 2020 (data up to date as of March 20, 2020).最初于 2020年3月27日 在 https://www.linkedin.com 上 发布 (数据截至2020年3月20日)。 Day 3 of social distancing.社会疏离的第三天。 As I sit on…