大佬教程收集整理的这篇文章主要介绍了如何使用CSS将“Ubuntu Font Family”添加到我的网站?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
/* ##### Common Styles ##### */ body { color: black; BACkground-color: white; font-family: "times new roman",times,roman,serif; font-size: 12pt; margin: 0; padding: 0; } acronym,.titleTip { font-style: italic; border-bottom: none; }
要么
/* ##### Header ##### */ #header { margin: 0; padding: 0; border-bottom: 1px solid black; } .headertitle { font-size: 200%; margin: 0; padding: 0 0 0.5ex 0; } .headertitle a { color: black; BACkground-color: transparent; font-family: "trebuchet ms",verdana,Helvetica,arial,sans-serif; font-weight: normal; text-decoration: none; } .subHeader { display: none; } /* ##### Side Bars ##### */ #side-bar { display: none; } /* ##### Main Copy ##### */ #main-copy { text-align: justify; margin: 0; padding: 0; } #main-copy h1 { font-family: "trebuchet ms",sans-serif; font-size: 120%; margin: 2ex 0 1ex 0; padding: 0;
我在哪里添加Ubuntu字体系列?我是否插入错误的代码来帮助您,帮助我?
首先,您必须确保,您的网站具有该字体,以防您的网站的普通用户没有这种字体.
选项1 – 从外部提供商导入
您可以从外部字体主机(如Google字体)导入整个字体文件和设置.只需将此代码放在HTML中即可从外部导入:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=LaTin">
选项2 – 将其存储在服务器中
您可以下载然后将字体文件上传到您的服务器,然后通过您的CSS中的@ font-face导入它们.在这个例子中,您的字体文件的位置将是http://example.com/fonts/ubuntu.woff.
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; src: local('Ubuntu'),url(http://example.com/fonts/ubuntu.woff) format('woff'); }
使用字体
那么你必须指定要在哪里使用该字体.只需添加Ubuntu到您的font-family列表:
body { font-family: Ubuntu,"times new roman",serif; }
此示例代码将给出您的HTML页面中的每个文本的Ubuntu字体,如果它是avilable.
以上是大佬教程为你收集整理的如何使用CSS将“Ubuntu Font Family”添加到我的网站?全部内容,希望文章能够帮你解决如何使用CSS将“Ubuntu Font Family”添加到我的网站?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。