css 字体粗细设置为正常,但在浏览器上显示为粗体

dwbf0jvd  于 2023-02-01  发布在  其他
关注(0)|答案(2)|浏览(262)

我将. meta、.sender、.to和. receiver的字体粗细设置为正常。但是,这仍然会将框中间的所有内容的文本显示为粗体。我不太确定我做错了什么,以及为什么它没有更改为正常。

<table class="label">
  <tr>
    <td class="sign">F</td>
    <td class="holder">
      <div class="flexbox">
        <div class="internet-base">
          Internert Base
        </div>
        <div class="box">
          FIRST-CLASS<br />
          ePostage<br />
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="title">FIRST-CLASS</td>
  </tr>
  <tr>
    <td colspan="2" class="row">
      <p class="sender">
        {{fromName}}
        <br />
        {{refNumber}} <br />
      </p>
      <p class="meta">
        Email Date: {{labelDate}}
        <br />
        Memory: {{emailWeight}} kb
      </p>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="receiver">
       <!-- <p class="signature">SIGNATURE WAIVED</p> -->
      <p class="to" style="padding-top: 10px">
        {{toName}}
        <br />
        {{toRefNumber}}<br />
      </p>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="barcode">
      <p class="note">TRACKING # EP</p>
      <img src="data:image/png;base64, {{barImage}}" alt="" class="img" />
    </td>
  </tr>
  <tr>
    <td colspan="2" class="footer"><img src="https://cdn.suwalls.com/wallpapers/vector/sad-panda-hidden-in-the-white-background-47723-2880x1800.jpg" width="93" height="29"> </td>
  </tr>
</table>

<style>
  @import url("http://fonts.cdnfonts.com/css/helvetica-neue-9");

  @page {
    margin: 0px;
  }

  body {
    margin: 0px;
  }

  * {
    font-family: "Helvetica Neue", sans-serif;
  }

  p {
    margin-top: 0;
    margin-bottom: 5px;
  }

  .label {
    width: 600px;
    border: 2px solid black;
    border-collapse: collapse;
    font-weight: bold;
  }

  .sign {
    font-size: 140px;
    margin: 0;
    border: 2px solid black;
    width: 160px;
    padding-top: 20px;
    text-align: center;
    font-weight: bold;
  }

  .title {
    text-align: center;
    font-size: 37px;
    border: 2px solid black;
    padding-top: 12px;
    padding-bottom: 2px;
  }

  .barcode {
    border: 2px solid black;
    text-align: center;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 4px solid black;
    border-bottom: 4px solid black;
  }

  .img {
    width: 70%;
  }

  .footer {
    height: 50px;
    min-height: 50px;
  }

  .row {
    height: 150px;
    min-height: 150px;
    vertical-align: top;
  }

  .signature {
    font-size: 18px;
    padding-left: 9px;
    padding-bottom: 10px;
  }

  .meta {
    text-align: right;
    float: right;
    padding-top: 9px;
    padding-right: 9px;
    font-size: 18px;
    font-weight: normal; 
  }

  .sender {
    text-align: left;
    float: left;
    padding-top: 9px;
    padding-left: 9px;
    font-size: 18px;
    line-height: initial;
    font-weight: normal; 
  }

  .to {
    padding-left: 40px;
    padding-top: 20px;
    font-size: 18px;
    font-weight: normal; 
  }

  .receiver {
    font-size: 18px;
    vertical-align: top;
    padding-top: 60px;
    padding-bottom: 60px;
    font-weight: normal; 
  }

  .box {
    border: 2px solid black;
    text-align: center;
    padding: 5px;
    width: 130px;
    font-size: 13px;
    float: right;
    margin-right: 50px;
  }

  .holder {
    vertical-align: middle;
    display: table-cell;
  }

  .note {
    font-size: 17px;
    padding-bottom: 10px;
  }

  .flexbox {
    display: flex;
    align-items: center;
  }
  
  .internet-base {
    margin-left: auto;
    margin-right: 10px;
  }
  
  /* New */
  
  .footer {
    text-align: center;
  }
  .footer img {
      margin-right: 45px;
  }

</style>

以下内容不应全部用粗体显示:

wb1gzix0

wb1gzix01#

看起来不大胆,但如果你认为这是大胆的,然后只是使用字体从Google fonts与较小的字体重量(如400或300)。
然后在CSS中应用它:

* {
  font-family: 'Font-Family-Name', sans-serif;
  font-weight: 300;
}
6mzjoqzu

6mzjoqzu2#

问题似乎出在处理字体文件的方式上。
在导入的url中添加一个www至少对我来说在Edge/Chrome和Windows10上的Firefox来说已经解决了这个问题。一个“正常”的字体现在被选中了。

<table class="label">
  <tr>
    <td class="sign">F</td>
    <td class="holder">
      <div class="flexbox">
        <div class="internet-base">
          Internert Base
        </div>
        <div class="box">
          FIRST-CLASS<br /> ePostage
          <br />
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="title">FIRST-CLASS</td>
  </tr>
  <tr>
    <td colspan="2" class="row">
      <p class="sender">
        {{fromName}}
        <br /> {{refNumber}} <br />
      </p>
      <p class="meta">
        Email Date: {{labelDate}}
        <br /> Memory: {{emailWeight}} kb
      </p>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="receiver">
      <!-- <p class="signature">SIGNATURE WAIVED</p> -->
      <p class="to" style="padding-top: 10px">
        {{toName}}
        <br /> {{toRefNumber}}
        <br />
      </p>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="barcode">
      <p class="note">TRACKING # EP</p>
      <img src="data:image/png;base64, {{barImage}}" alt="" class="img" />
    </td>
  </tr>
  <tr>
    <td colspan="2" class="footer"><img src="https://cdn.suwalls.com/wallpapers/vector/sad-panda-hidden-in-the-white-background-47723-2880x1800.jpg" width="93" height="29"> </td>
  </tr>
</table>

<style>
  @import url("http://www.fonts.cdnfonts.com/css/helvetica-neue-9");
  @page {
    margin: 0px;
  }
  
  body {
    margin: 0px;
  }
  
  * {
    font-family: "Helvetica Neue", sans-serif;
  }
  
  p {
    margin-top: 0;
    margin-bottom: 5px;
  }
  
  .label {
    width: 600px;
    border: 2px solid black;
    border-collapse: collapse;
    font-weight: bold;
  }
  
  .sign {
    font-size: 140px;
    margin: 0;
    border: 2px solid black;
    width: 160px;
    padding-top: 20px;
    text-align: center;
    font-weight: bold;
  }
  
  .title {
    text-align: center;
    font-size: 37px;
    border: 2px solid black;
    padding-top: 12px;
    padding-bottom: 2px;
  }
  
  .barcode {
    border: 2px solid black;
    text-align: center;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 4px solid black;
    border-bottom: 4px solid black;
  }
  
  .img {
    width: 70%;
  }
  
  .footer {
    height: 50px;
    min-height: 50px;
  }
  
  .row {
    height: 150px;
    min-height: 150px;
    vertical-align: top;
  }
  
  .signature {
    font-size: 18px;
    padding-left: 9px;
    padding-bottom: 10px;
  }
  
  .meta {
    text-align: right;
    float: right;
    padding-top: 9px;
    padding-right: 9px;
    font-size: 18px;
    font-weight: normal;
  }
  
  .sender {
    text-align: left;
    float: left;
    padding-top: 9px;
    padding-left: 9px;
    font-size: 18px;
    line-height: initial;
    font-weight: normal;
  }
  
  .to {
    padding-left: 40px;
    padding-top: 20px;
    font-size: 18px;
    font-weight: normal;
  }
  
  .receiver {
    font-size: 18px;
    vertical-align: top;
    padding-top: 60px;
    padding-bottom: 60px;
    font-weight: normal;
  }
  
  .box {
    border: 2px solid black;
    text-align: center;
    padding: 5px;
    width: 130px;
    font-size: 13px;
    float: right;
    margin-right: 50px;
  }
  
  .holder {
    vertical-align: middle;
    display: table-cell;
  }
  
  .note {
    font-size: 17px;
    padding-bottom: 10px;
  }
  
  .flexbox {
    display: flex;
    align-items: center;
  }
  
  .internet-base {
    margin-left: auto;
    margin-right: 10px;
  }
  /* New */
  
  .footer {
    text-align: center;
  }
  
  .footer img {
    margin-right: 45px;
  }
</style>

相关问题