前军教程网

中小站长与DIV+CSS网页布局开发技术人员的首选CSS学习平台

话说前端11-css的文字属性(前端字体样式)

分享兴趣,传播快乐,增长见闻,留下美好!

亲爱的您,这里是LearningYard学苑。

Share interest, spread happiness, increase knowledge, and leave behind beauty!

Dear you, this is LearningYard Academy.


今天小编为大家带来话说前端(十一)----css的文字属性,欢迎您的访问。

今天来讲一讲文字的属性

Today, Xiaobian brings you the front end (11)-the character attribute of CSS. Welcome to visit.

Let's talk about the attributes of words today.

首先关于颜色:有背景颜色和字体颜色,背景颜色属性为background-color:,我们可以直接给他blue,也可以写成rgb的形式,也可以写成三原色的形式,如:rgb(16,16,16),#cffff。再者就是字体颜色,属性为color,添加的颜色跟背景颜色的格式一样。

First of all, about color: there are background color and font color, and the background color attribute is background-color:. We can give it to him directly, or it can blue written in the form of rgb or three primary colors, such as: rgb(16, 16, 16), #cffff. Furthermore, it is the font color, the attribute is color, and the added color has the same format as the background color.

第二就是字体的样式,在word里头可以有楷体,草书,黑体,同样的在网页上也可以这样显示。用的就是font-family:,但是要记住,这个字体你一定是要下载过的,如果没有下载,那么就会默认显示和黑体。再者就是font-style:,这个样式可以把他设置为斜体。

The second is the font style. In word, there can be regular script, cursive script and bold font, and the same can be displayed on the webpage. Use font-family:, but remember, you must have downloaded this font. If you haven't downloaded it, it will be displayed in bold by default. Furthermore, it is font-style:, which can set it in italics.

第三字体的粗细,用font-weight,正常是400,注意没有单位,400以上就会变大,400一下就会变小,font-size为字体大小,正常写成14px,,上曾下减。

The thickness of the third font, using font-weight, is normally 400. Note that if there is no unit, it will get bigger if it is above 400, and it will get smaller once it is 400. font-size is the font size, which is normally written as 14px, and it has been decreased from top to bottom.

第四就是line-hight,行高,如果行高等于容器的高度,在上下居中,同样的和text-align:center连用可以保证中心居中。

The fourth is line-high, line height. If the line height is higher than the height of the container, it is centered on the top and bottom. The same can be used with text-align: center to ensure the center is centered.

第五text-decoration,可以有下划线:underline,贯穿线line-througn,还有在顶部的线(不常用)

The fifth text-decoration can be underlined: underline, through line-throughput, and the line at the top (not commonly used).

今天的分享就到这里,如果你有什么独特的想法,欢迎给我们留言,让我们相约明天,祝你今天过得开心快乐。

翻译:Google翻译

本文由LearningYard新学苑原创,部分图片文字来自网络,如有侵权请联系。

That's all for today's sharing. If you have any unique ideas, please leave us a message and let's make an appointment tomorrow. I wish you a happy day.


Translation: Google translation


This article is original by LearningYard New Academy, and some pictures and texts are from the Internet. If there is any infringement, please contact.

文案:李仕阳

排版:李仕阳

审核:闫庆红

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言