css怎么把单个字拉瘦和歪斜

html-css014

css怎么把单个字拉瘦和歪斜,第1张

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<title></title>

<style type="text/css">

.style{

font-family: "microsoft yahei", arial /*字体样式*/

font-size: 14px /*字体大小 (参考值: 5px ~ 50px)*/

font-style: italic /*字体斜体 (参考值: normal italic)*/

font-weight: 500 /*字体加粗 (参考值:300,500,700)*/

}

</style>

</head>

<body>

<div id="">

css怎么把单个字 <cite class="style">拉瘦和歪斜</cite>

</div>

</body>

</html>

你看他的font.css这个文件里,有这么一句

@font-face {

font-family: 'LeagueGothicRegular'

src: url('../fonts/leaguegothic/League_Gothic-webfont.eot')

src: local('☺'), url('../fonts/leaguegothic/League_Gothic-webfont.woff') format('woff'), url('../fonts/leaguegothic/League_Gothic-webfont.ttf') format('truetype'), url('../fonts/leaguegothic/League_Gothic-webfont.svg#webfontFHzvtkso') format('svg')

font-weight: normal

font-style: normal

}

这是引用webfont文件的。

你在你的html文件的header里面也引用一下他的font.css就行了。

加这么一句

<link rel="stylesheet" type="text/css" media="all" href="http://simpleasmilk.co.uk/wp-content/themes/simpleasmilk/css/fonts.css" />

由于字体是“有级缩放”(就像风扇的档位调节开关,只能调1档、2档、3档这些,不能1.5档,或者2.1111档等),不是“无级缩放”(就像音响上的音量旋钮,可以调到任意的位置),因此要想真正实现按百分比来缩放是不太现实的。一个变通的方法是利用css3的新长度单位rem(根元素的字体大小),其默认值是16px,那么1.5rem就是16*1.5=24px,0.75rem就是16*0.75=12px。比如font-size:1.5rem