如果您对在CSS中使用多个@font-face规则和css可以被多个文本使用感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解在CSS中使用多个@font-face规则的各种细节,并对css可以被
如果您对在CSS中使用多个@ font-face规则和css可以被多个文本使用感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解在CSS中使用多个@ font-face规则的各种细节,并对css可以被多个文本使用进行深入的分析,此外还有关于.htaccess中的多个mod_rewrite规则、CSS @font-face 规则的用法、css @语法,@规则 @import @charset @font-face @fontdef @media @page、css font-face with Arabic fonts的实用技巧。
本文目录一览:- 在CSS中使用多个@ font-face规则(css可以被多个文本使用)
- .htaccess中的多个mod_rewrite规则
- CSS @font-face 规则的用法
- css @语法,@规则 @import @charset @font-face @fontdef @media @page
- css font-face with Arabic fonts
在CSS中使用多个@ font-face规则(css可以被多个文本使用)
如何@font-face
在CSS中使用多于规则的内容?
我已将其插入样式表中:
body { background: #fff url(../images/body-bg-corporate.gif) repeat-x; padding-bottom: 10px; font-family: ''GestaRegular'', Arial, Helvetica, sans-serif;}@font-face { font-family: ''GestaReFogular''; src: url(''gestareg-webfont.eot''); src: local(''☺''), url(''gestareg-webfont.woff'') format(''woff''), url(''gestareg-webfont.ttf'') format(''truetype''), url(''gestareg-webfont.svg#webfontg8dbVmxj'') format(''svg'');}
当前,这仅适用于网站上的整个文本。但是,我想指定h1
使用其他字体。我怎样才能做到这一点?
答案1
小编典典其中包括您在下面看到的CSS的更具描述性的细分(并说明了使它在IE6-9上更好地工作的调整)。
@font-face { font-family: ''Bumble Bee''; src: url(''bumblebee-webfont.eot''); src: local(''☺''), url(''bumblebee-webfont.woff'') format(''woff''), url(''bumblebee-webfont.ttf'') format(''truetype''), url(''bumblebee-webfont.svg#webfontg8dbVmxj'') format(''svg'');}@font-face { font-family: ''GestaReFogular''; src: url(''gestareg-webfont.eot''); src: local(''☺''), url(''gestareg-webfont.woff'') format(''woff''), url(''gestareg-webfont.ttf'') format(''truetype''), url(''gestareg-webfont.svg#webfontg8dbVmxj'') format(''svg'');}body { background: #fff url(../images/body-bg-corporate.gif) repeat-x; padding-bottom: 10px; font-family: ''GestaRegular'', Arial, Helvetica, sans-serif;}h1 { font-family: "Bumble Bee", "Times New Roman", Georgia, Serif;}
.htaccess中的多个mod_rewrite规则
我有几个mod_rewrite规则难以在我的.htaccess文件中一起工作。 在整个网站我想放弃“www”。 来自所有url 我在文档根目录下使用以下内容:
Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301]
然后,在一个文件夹“/帮助”我想做2重写:
将domain.com/help/1更改为 domain.com/index.PHP?question=1
将domain.com/help/category/example更改为 domain.com/index.PHP?category=example
所以在domain.com/help我有以下几点:
Options +FollowSymLinks RewriteRule ^([0-9]+)/?$ index.PHP?question=$1 [NC,L] RewriteRule ^category/([^/.]+)/?$ index.PHP?category=$1 [NC,L]
上述2个.htaccess文件适用于:
www.domain.com 到 domain.com
domain.com/help/1 到 domain.com/index.PHP?question=1
domain.com/help/category/example to domain.com/index.PHP?category=example
.htaccess重写规则,以防止caching的CSS,JS,图像文件。
使用Apache的Flowplayer安全stream式传输
Htaccess用FastCGI重写
请求实体太大的PHP
在根目录下安装CodeIgniter,在子目录下不工作
但是,这不起作用,当我需要结合2重写,都放弃“www”。 并将子文件夹重写为一个urlvariables。 例如:
www.domain.com/help/1 到 domain.com/index.PHP?question=1
给出了500错误。
我哪里做错了? 而且,最好是使用2 .htaccess文件,还是应该将2个文件合并到文档根目录下的.htaccess文件中?
使用htaccessredirect一个基于它的第一个字符的URL
如何根据查询stringredirecturl?
RewriteCond和RewriteRule在.htaccess中
.htaccess RewriteRule添加到URL的驱动器path
.HTACCESS文件导致内部服务器错误
它看起来像是发生了什么是在/ help文件夹中.htaccess文件中的规则正在申请,因为你要求在该文件夹中的东西,所以父文件夹的规则将不会得到应用。 如果您在/ help文件夹的.htaccess中添加RewriteOptions Inherit ,则可以传递父规则:
Options +FollowSymLinks RewriteOptions Inherit RewriteRule ^([0-9]+)/?$ index.PHP?question=$1 [NC,L]
但是,继承的规则可能不会按照您期望的顺序应用。 例如,如果您请求http://www.domain.com/help/1/,您最终将被重定向到http://domain.com/index.PHP?question=1 ,这可能不是您想要的如果您试图通过隐藏查询字符串来使搜索引擎优化友好的网址。
最好的方法是将/ help文件夹中的内容移动到文档根目录中,以便控制规则的应用顺序:
Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301] RewriteRule ^help/([0-9]+)/?$ /index.PHP?question=$1 [NC,L] RewriteRule ^help/category/([^/.]+)/?$ /index.PHP?category=$1 [NC,L]
这确保首先发生到非www域的重定向,然后应用/ help规则。 所以当你去http://www.domain.com/help/1/时 ,你首先被重定向到http://domain.com/help/1/,然后帮助规则被应用,并且URI被重写到/index.PHP?question=1 。
CSS @font-face 规则的用法
@font-face规则用于详细描述文档中使用的字体。@font-face也可以用于定义字体的下载位置,尽管这可能会遇到特定实现的限制。
示例
<style> <!-- @font-face { font-family: "Scarborough Light"; src: url("http://www.font.site/s/scarbo-lt"); } @font-face { font-family: Santiago; src: local ("Santiago"), url("http://www.font.site/s/santiago.tt") format("truetype"); unicode-range: U+??,U+100-220; font-size: all; font-family: sans-serif; } --> </style>
以上就是CSS @font-face 规则的用法的详细内容,更多请关注php中文网其它相关文章!
css @语法,@规则 @import @charset @font-face @fontdef @media @page
CSS At-Rules Reference 样式表规则
At-Rules
样式表规则
CSS Version
版本
Compatibility
兼容性
Description
简介
@import
CSS1
IE4+
指定导入的外部样式表及目标媒体。该规则必须在样式表头部最先声明
@charset
CSS2
IE4+
在外部样式表文件内使用。指定该样式表使用的字符集。请参阅附录:字符集
@font-face
CSS2
IE4+
设置嵌入HTML文档的OpenType字体
@fontdef
NS专有规则
NS4+
设置嵌入HTML文档的字体
@media
CSS2
IE5+
指定样式表规则用于指定的媒体类型
@page
CSS2
IE5.5+
设置页面容器的版式,方向,边空等
说明:这种颜色是CSS2标准规则。这种颜色是IE建议样式表规则。这种颜色是NS私有规则。这种颜色是目前尚无浏览器支持的规则。
css font-face with Arabic fonts
@font-face { font-family: "My"; src: url(GE_SS_TV_Bold.otf) format("truetype"); } p.customfont { font-family: "My",Verdana,Tahoma; }
它看起来像这样:
但它应该看起来像:
解决方法
同样在你的文档中你似乎混合了truetype和opentype;)otf = OpenType字体,ttf =通常是TrueType字体.如果你改写怎么样?
@font-face { font-family: "My"; src: url(GE_SS_TV_Bold.otf) format("opentype"); }
如果你需要一种不同格式的字体,你就有了这些文件
@font-face { font-family: "My"; src: url(GE_SS_TV_Bold.otf) format("opentype"),src: url(GE_SS_TV_Bold.ttf) format("truetype"); }
今天的关于在CSS中使用多个@ font-face规则和css可以被多个文本使用的分享已经结束,谢谢您的关注,如果想了解更多关于.htaccess中的多个mod_rewrite规则、CSS @font-face 规则的用法、css @语法,@规则 @import @charset @font-face @fontdef @media @page、css font-face with Arabic fonts的相关知识,请在本站进行查询。
本文标签: