简体   繁体   English

字体未呈现(使用引导程序)

[英]Font not rendering (using bootstrap)

So I am trying to use a custom font, actually I'm using two of them. 所以我尝试使用自定义字体,实际上我正在使用其中的两种。 However, only one of them is rendering in the website. 但是,其中只有一个正在网站中呈现。 I tried switching them around to make sure it wasn't the reference to the second font, but then it worked fine so it wasn't that. 我尝试切换它们以确保它不是对第二种字体的引用,但随后它工作正常,因此不是那样。 I can't figure out where I'm going wrong. 我不知道我要去哪里。 Oswald is the font rendering just fine. Oswald的字体渲染就很好。 Quattracento is the one not working. Quattracento是不起作用的。 Any advice? 有什么建议吗?

HTML: HTML:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Arrow's Edge - Our Services</title>

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.css">
<link rel="stylesheet" href="css/style.css">

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>    
<script src="js/bootstrap.min.js"></script>

<!-- fonts -->
<link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Quattrocento' rel='stylesheet' type='text/css'>
</head>


<body>
<!-- HTML for navbar -->
<nav class="navbar nav navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
  <a class="navbar-brand logo-fit" href="index.html"><img id ="logo-bar" src="images/logo-bar.png" alt="Arrow's Edge Logo"></a>

  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
      <span class="sr-only">Toggle Navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
  </button>
</div>

<ul class="nav navbar-nav navbar-inverse navbar-right collapse navbar-collapse">
    <li><a href="index.html">Home</a></li>
    <li><a href="our-services.html">Our Services</a></li>
    <li><a href="#" data-toggle="dropdown">About Us<span class="caret"></span></a>
        <ul class="dropdown-menu inverse-dropdown">
            <li><a href="blog.html">Blog</a></li>
            <li><a href="our-story.html">Our Story</a></li>
            <li class="divider"></li>
            <li><a href="#">Facebook</a></li>
        </ul>    
    </li>
    <li><a href="contact-us.html">Contact Us</a></li>
  </ul>

</div>
</nav>

<!-- end of HTML for navbar -->  

<!-- HTML for Our Servies page -->
<div class="row">
<div class="col-md-4 col-lg-4 col-sm-4 col-xs-8 col-sm-offset-4 col-md-offset-4 col-lg-offset-4 col-xs-offset-2 text-center design-header"><p>Web Design</p>
</div>
</div>

<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 text-center">
    <div class="custom"><span class="custom-header">Custom:</span> <br>
        <span class="my-text">We have a passion for designing new, cutting edge websites that are tailored to your specific needs. Need a site for a small business? A blog? A fan page? No problem! We have you covered.</span>
    </div>
</div>

</div>




</body>
</html>

CSS: CSS:

/* Style for the Our Services page */

.design-header {
font-family: 'Oswald', sans-serif;
font-size: 40px;
margin-top: 15px;
border-bottom: 2px solid black;
padding-bottom: 10px;
}

.custom {
margin-top: 50px;
margin-left: 25px;
}


.custom-header {
font-family: 'Oswald', sans-serif;
font-size: 25px;
}


.my-text: {
font-family: 'Quattrocento', serif;
}

You have a : just after your CSS selector, remove it. 您在CSS选择器之后有一个: ,将其删除。

/* Old CSS 
.my-text: {
   font-family: 'Quattrocento', serif;
} */

/* New CSS */
.my-text {
   font-family: 'Quattrocento', serif;
}

将 class 添加到<div>标签导致字体渲染延迟(引导程序 4)</div><div id="text_translate"><p> 我有 2 张引导程序 4 张图片卡,在甲板上。 单击时它们会翻转以显示它们背面的信息。 其中一些信息包含在我想放在卡片底部的 div 中,为此我添加了 class align-self-end以及一些 css 用于该 ZA2F2ED4F8EBC2CBB4C21A29DC40AB61D 这工作得很好。 但是,仅添加此 class 会导致单击时卡背面显示的信息延迟约 500 毫秒。 我对造成这种情况的原因一无所知。</p><p> <strong>这是我的 html 卡:</strong></p><pre> &lt;div class="card mb-4 mt-4" style="max-width: 300px; min-width: 300px display: block;" data-clickable="true"&gt; &lt;div class="card-inner"&gt; &lt;img src="https://via.placeholder.com/1420x1933" class="card-img" alt="..."&gt; &lt;div class="card-img-overlay"&gt; &lt;div class="cardContent"&gt; &lt;h5 class="card-title"&gt;Card Title&lt;/h5&gt; &lt;p class="card-text info"&gt;This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.&lt;/p&gt; &lt;/div&gt; &lt;div class="alignToEnd"&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;1: &lt;/b&gt;John&lt;/p&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;2: &lt;/b&gt;Smith&lt;/p&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;3: &lt;/b&gt;2008&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre><p> <strong>这是用于 align-self-end 的 css:</strong></p><pre> .alignToEnd { -ms-flex-wrap:wrap;flex-wrap:wrap; position:absolute; bottom:0; left:0; width:100%; display:-webkit-box; display:-ms-flexbox; display:flex-end; -webkit-box-align:left; -ms-flex-align:left; align-items:left; -webkit-box-pack:left; -ms-flex-pack:left; justify-content:left; padding-bottom: 10px; padding-left: 10px; }</pre><p> 我已经使用简化的 class 进行了尝试,它实现了类似的结果,使用以下 css align-self-end :</p><pre> .align-self-end { position:absolute; bottom:2rem; }</pre><p> 这是我的代码笔。 左边的卡片没有 class,右边的卡片有 class 将信息移到最后,点击后背面的信息需要更长的时间才能出现。 第一次点击后需要刷新页面才能刷新缓存,重复效果。</p><p> <a href="https://codepen.io/Darlton29/pen/bGVojWE" rel="nofollow noreferrer">https://codepen.io/Darlton29/pen/bGVojWE</a></p></div> - Adding class to <div> tag causes delay in font rendering (Bootstrap 4)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bootstrap 3 vs Bootstrap 4字体渲染 - Bootstrap 3 vs Bootstrap 4 font rendering 将 class 添加到<div>标签导致字体渲染延迟(引导程序 4)</div><div id="text_translate"><p> 我有 2 张引导程序 4 张图片卡,在甲板上。 单击时它们会翻转以显示它们背面的信息。 其中一些信息包含在我想放在卡片底部的 div 中,为此我添加了 class align-self-end以及一些 css 用于该 ZA2F2ED4F8EBC2CBB4C21A29DC40AB61D 这工作得很好。 但是,仅添加此 class 会导致单击时卡背面显示的信息延迟约 500 毫秒。 我对造成这种情况的原因一无所知。</p><p> <strong>这是我的 html 卡:</strong></p><pre> &lt;div class="card mb-4 mt-4" style="max-width: 300px; min-width: 300px display: block;" data-clickable="true"&gt; &lt;div class="card-inner"&gt; &lt;img src="https://via.placeholder.com/1420x1933" class="card-img" alt="..."&gt; &lt;div class="card-img-overlay"&gt; &lt;div class="cardContent"&gt; &lt;h5 class="card-title"&gt;Card Title&lt;/h5&gt; &lt;p class="card-text info"&gt;This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.&lt;/p&gt; &lt;/div&gt; &lt;div class="alignToEnd"&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;1: &lt;/b&gt;John&lt;/p&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;2: &lt;/b&gt;Smith&lt;/p&gt; &lt;p class="smallinfo"&gt;&lt;b&gt;3: &lt;/b&gt;2008&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre><p> <strong>这是用于 align-self-end 的 css:</strong></p><pre> .alignToEnd { -ms-flex-wrap:wrap;flex-wrap:wrap; position:absolute; bottom:0; left:0; width:100%; display:-webkit-box; display:-ms-flexbox; display:flex-end; -webkit-box-align:left; -ms-flex-align:left; align-items:left; -webkit-box-pack:left; -ms-flex-pack:left; justify-content:left; padding-bottom: 10px; padding-left: 10px; }</pre><p> 我已经使用简化的 class 进行了尝试,它实现了类似的结果,使用以下 css align-self-end :</p><pre> .align-self-end { position:absolute; bottom:2rem; }</pre><p> 这是我的代码笔。 左边的卡片没有 class,右边的卡片有 class 将信息移到最后,点击后背面的信息需要更长的时间才能出现。 第一次点击后需要刷新页面才能刷新缓存,重复效果。</p><p> <a href="https://codepen.io/Darlton29/pen/bGVojWE" rel="nofollow noreferrer">https://codepen.io/Darlton29/pen/bGVojWE</a></p></div> - Adding class to <div> tag causes delay in font rendering (Bootstrap 4) 使用自定义字体时,Masonry 和 Bootstrap 无法正确呈现(在新加载时) - Masonry and Bootstrap not rendering properly when custom font used (on a fresh load) 字体无法渲染? - Font not rendering? 使用 Bootstrap 和 Font Awesome 图标字体的搜索栏 - Search bar using Bootstrap and Font Awesome icon font 使用集合渲染Bootstrap3表时出现问题 - Issues rendering a Bootstrap3 table using a collection 使用twitter引导程序在移动设备上显示更大的字体 - bigger font on mobile devices using twitter bootstrap 使用具有特定字体和样式的引导程序创建页面 - creating page using bootstrap with specific font and style Bootstrap标头不使用CSS字体系列 - Bootstrap Header not using CSS font family 使用CSS / Bootstrap的自适应字体大小 - Responsive font-size using css/Bootstrap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM