簡體   English   中英

如何在CSS中正確添加字體大小?

[英]How do I add font-size properly in my css?

我正在嘗試將字體大小更改添加到CSS中的特定p上。

我做了一個新的類.mainbg p { xxxx }但這是行不通的。 奇怪的是,當我為該p添加文本陰影時,同一個類起作用。 我不明白為什么它對此不起作用。

<section aria-label="home" class="mainbg" id="home">

    <!-- intro -->
    <div class="container">
    <div class="row">
    <div class="overlay-main v-align">
      <div class="col-md-10 col-xs-11">

        <h1 class="onStep" data-animation="animbouncefall" data-time="300">LOUIS WALLACE CONSTRUCTION</h1>
        <div class="onStep" data-animation="fadeInUp" data-time="600" id="slidertext">
          <h3 class="main-text">Oroville General Contractor</h3>
          <h3 class="main-text">Over A Decade Of Experience</h3>
          <h3 class="main-text">All Phases Of Construction</h3>
        </div>
        <p class="onStep" data-animation="animbouncefall" data-time="900" >No matter how large or small the project, we ensure that your project is completed with precision and professionalism. We take pride in our quality craftsmanship, our attention to detail, and our open line of communication with each and every customer. With each project, we understand that our role is about more than simply putting up walls — it’s about ensuring that your vision is turned into a reality.

似乎是另一個默認CSS覆蓋了您的P標簽樣式。

在CSS聲明中使用!important

例如:

.mainbg p { 
   font-size:12px !important;
 }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM