css 更改字体大小和格式

lkaoscv7  于 2023-02-26  发布在  其他
关注(0)|答案(2)|浏览(166)

基于下面的代码,我如何改变字体大小和格式?
对于我试过的尺寸:
方法1(不起作用)

.text-large {
  font-size: 150%;
}

方法2(也不起作用)

html {
    font-size: 16px;
}

代码:
一个二个一个一个

cxfofazt

cxfofazt1#

Bootstrap默认为16px = 1rem,根据这些信息,我将您的两个容器类添加到CSS中,并将所有内容都设置为2rem

.footer-background.container-fluid {
  font-size: 2rem;
}

a {
  color: white;
}

.footer-background {
  padding-top: 20px;
  padding-bottom: 20px;
  background-color: #1c2a48;
}

.logo,
.nav {
  margin-bottom: 10px;
}

.nav-pills {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav .external-link {
  padding: 2px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="footer-background container-fluid">
  <div class="row">
    <div class="col-xs-6 col-sm-4 center-block">
      <ul class="nav nav-pills">
        <li><a class="external-link" href="https://www.b.org/opengovernment/prr/Pages/default.aspx">Public Records Request</a></li>
        <li><a class="external-link" href="https://www.b.org/AgenciesAndServices/Pages/Default.aspx">Contact Us</a></li>
        <li><a class="external-link" href="https://www.b.org/ReportAComplaint/Pages/Default.aspx">Report a Complaint</a></li>
        <li><a class="external-link" href="https://www.b.org/Terms/Pages/Default.aspx">Terms of Use</a></li>
        <li><a class="external-link" href="https://www.b.org/Terms/Pages/Default.aspxx">Accessiblity Statement</a></li>
        <li><a class="external-link" href="https://lp.constantcontactpages.com/su/ErJFVZz/BrowardLife">Subscribe</a></li>
      </ul>
    </div>
    <div class="col-xs-6 col-sm-4 center-block">
      <ul class="nav nav-pills">
        <li><a class="external-link" href="https://b.granicus.com/ViewPublisher.php?view_id=15">Watch Meetings</a></li>
        <li><a class="external-link" href="https://www.b.org/Pages/Welcome.aspx">Copyrights 2022, Government</a></li>
      </ul>
    </div>
    <div class="col-xs-12 col-sm-4">
      <div class="text-white" style="padding-top: 3rem; text-align: center;">
        <ul class="nav nav-pills">
        </ul>
      </div>
    </div>
  </div>
</div>
6rqinv9w

6rqinv9w2#

我将这两个类添加到了你的css中,并且能够将字体更改为Times New Roman,并增加字体大小。

<!-- add to your css -->
ul.nav-pills {
 font-family: "Times New Roman", Times, serif;} !important

.test {
 font-size: 24px;}

<!-- add class to yur li -->
<li class="test"><a class="external-link" href="https://www.b.org/opengovernment/prr/Pages/default.aspx">Public Records Request</a></li>

https://jsfiddle.net/jasonbruce/xefkmg20/3/

相关问题