怎么让css里的字体有

html-css011

怎么让css里的字体有,第1张

css引入外部字体

@font-face{font-family: 'YaHei Consolas Hybrid' src : url('../fonts/yaheiconsolashybrid.ttf')}body{font-family: 'YaHei Consolas Hybrid' font-size: 16px background: url(../img/bgContent.png) repeat}12345678910

不同浏览器字体的格式有差别

字体后缀和浏览器有关,如下所示

* .TTF或.OTF,适用于Firefox 3.5、Safari、Opera * .EOT,适用于Internet Explorer 4.0+

* .SVG,适用于Chrome、IPhone 比如:@font-face {font-family: 'HansHandItalic' src: url('fonts/hanshand-webfont.eot') src: url('fonts/hanshand-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/hanshand-webfont.woff') format('woff'), url('fonts/hanshand-webfont.ttf') format('truetype'), url('fonts/hanshand-webfont.svg#webfont34M5alKg') format('svg') font-weight: normal font-style: normal}

html编程一次性设定一个表格里所有单元格的字体,这个的话,你是可以使用css样式来控制,你可以直接tabletrtd这样来书写前面的样式,这里我提交一段代码:html>#div1{height:800widht:400px}tabletrtd{font-size:12px//字体大小color:#f00//字体颜色font-family:"微软雅黑"//字体}文字1文字2文字3文字4

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>div重叠 叠加实例 未排层叠顺序 www.divcss5.com</title>

<style>

.div-relative{position:relativecolor:#000border:1px solid #000width:500pxheight:400px}

.div-a{ position:absoluteleft:30pxtop:30pxbackground:#F00width:200pxheight:100px}

/* css注释说明: 背景为红色 */

.div-b{ position:absoluteleft:50pxtop:60pxbackground:#FF0width:400pxheight:200px}

/* 背景为黄色 */

.div-c{ position:absoluteleft:80pxtop:80pxbackground:#00Fwidth:300pxheight:300px}

/* DIV背景颜色为蓝色 */

</style>

</head>

<body>

<div class="div-relative">

<div class="div-a">我背景为红色</div>

<div class="div-b">我背景为黄色</div>

<div class="div-c">我背景为蓝色</div>

</div>

</body>

</html>