css中font、background、border样式的简写

html-css08

css中font、background、border样式的简写,第1张

font样式简写:

font:[font-style] [font-weight] [font-size] / [font-height] [font-family]

background样式简写:

background:[background-color] [background-image] [background-repeat] [background-position] / [background-size]

border样式简写:

border:[border-width] [border-style] [border-color]

其中font和background的样式属性顺序不可换,且"/"不可忽略,border的样式属性的顺序可任意。

css中font字体的设置方法如下:

1.在css页面中,设置字体的颜色通过下面的代码:

2.字体的color值,一般都是使用#加16进制的颜色值来表示。也有一些编译器支持直接使用颜色的英文单词来表示。如下图:

3.color是颜色的意思,color用来设置一个标签的前景色,表现出来也就是元素文本的颜色。css还可以设置字体的其他属性,如font-familay可以设置字体的类型,font-size可以设置字体的大小等。

扩展资料:

CSS

能够对网页中元素位置的排版进行像素级精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力。

参考资料:CSS-百度百科