css样式表中字体加粗的属性是什么?

html-css011

css样式表中字体加粗的属性是什么?,第1张

CSS字体加粗的方法:

font-weight 属性设置文本的粗细。使用 bold 关键字可以将文本设置为粗体。

例如:

html:

<p>字体加粗</p>

css:

p{

font-weight:blod

}

css中font样式常用的使用方法:

font-style:规定字体样式

font-weight:规定字体粗细

font-family:规定字体系列

两种方法给字体加粗,一种就是直接用<b>标签,例如 : <b>粗</b>

或者用css添加样式  <div style="font-weight: bold">加粗 </div>

可以用的值有下面这些。400 等同于 normal,而 700 等同于 bold。

normal   默认值

bold   定义粗体字符

bolder   定义更粗的字符

lighter   定义更细的字符

100

200

300

400

500

600

700

800

900

第一种:.pt{font-size:24pt}

第二种:

<p style="font-size:xx-small">关键字为xx-small。</p>

<p style="font-size:x-small">关键字为x-small。</p>

<p style="font-size:smaller">关键字为smaller。表示相对尺寸。</p>

<p style="font-size:small">关键字为small。</p>

<p style="font-size:medium">关键字为medium。这是浏览器默认的字号。</p>

<p style="font-size:large">关键字为large。</p>

<p style="font-size:larger">关键字为larger。表示相对尺寸。</p>

<p style="font-size:x-large">关键字为x-large。</p>

<p style="font-size:xx-large">关键字为xx-large。</p>

1.

你实际上只设了小方块的边:#big

.small

表示在id为big的元素内部class为small的元素,就是代码中的小方块而已。

如果你要给大小方块同时加边框,要用

#big,

.small{border:1px

solid

#0000FF}

2.

利用margin:

auto只能使元素水平居中而已,

用css垂直居中元素有些复杂,而且不同浏览器有不同表现,具体解决方法请参照http://www.blueidea.com/tech/web/2006/3231.asp