/(正斜杠)在css样式声明 [英] / (forward slash) in css style declarations

查看:231
本文介绍了/(正斜杠)在css样式声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

这个CSS字体的快捷语法是什么意思?

最近在检查苹果网站的样式时,我遇到了我不能理解的CSS规则声明:

Recently while checking apple's website's styling, I came across this CSS rule declaration which I could not understand:

body {
   font: 12px/18px "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
}

我不明白,因此想知道如何正斜杠 $ font:12px / 18px 实际工作?

I could not understand, and thus wanted to know that how does the forward slash in font: 12px/18px actually work?

推荐答案

font-size line-height

font: 12px/18px /*12px font-size and 18px line-height*/


$ b b

这是一个简单的符号...在CSS中还有更多,你可以使用例如

That's a short-hand notation...There are many more in CSS which you can use for example

margin-top: 10px;
margin-right: 20px;
margin-bottom: 30px;
margin-left: 40px;

可以简写为

margin: 10px 20px 30px 40px
         ^----^----^----^
       Top/Right/Bottom/Left

或者举例说明

border-width: 1px;
border-style:solid;
border-color: #ff0000;

可写为

border: 1px solid #f0000;

这是一个很酷的 列表 的CSS速记

Here's a cool list of CSS shorthand

这篇关于/(正斜杠)在css样式声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆