【发布时间】:2015-09-18 05:16:45
【问题描述】:
我目前正在开发一个 HTML,我正在使用 Bootstrap 使其更适合移动设备。但是,引导字体很糟糕,我希望覆盖它并用更好看的字体替换它。我发布了我的 HTML 文件的头部。它看起来像这样:
<head>
<title> Connotate Engineering </title>
<meta name=viewport content='width=700'>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="ConnotateEngineering.css">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
</head>
这就是我的 CSS 的样子:
body{
font-family: 'Arial';
font-size: 12px;
}
#images{
font-family: 'Arial';
text-align:left;
font-style: regular;
letter-spacing: 0;
line-height: 1.5em;
text-decoration: none;
word-spacing: 0;
}
#images a{
margin:0px 20px;
display:inline-block;
height: 100%;
text-decoration:none;
color:black;
font-family: 'Arial', serif;
}
.caption {
width: 200px;
text-align: center;
}
@media screen and (max-width:480px) {
#sidebar { display: none;}
}
【问题讨论】:
-
在 font-family 上使用关键字 !important。
-
喜欢在 font-family 之前添加吗?
-
例如,如果要确保字体始终为 arial,请执行以下操作: font-family: 'Arial' !important;