html - 如何在我的 css 中正确添加字体大小?

标签 html 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;
 }

关于html - 如何在我的 css 中正确添加字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54683038/

相关文章:

css - 如何反转关键帧?

html - Font Awesome 图标在 IE 中未正确对齐

html - 列表项相互堆叠,绝对定位

asp.net - 从 telerik 控件中删除默认内联样式

javascript - 如何在表的最后一行插入新行?

html - 如何将 svg 虚线从一点动画化到另一点?

javascript - 在 HTML5 Canvas 上绘制旋转文本

html - 我怎样才能让这些元素在同一行?

HTML2PDF 无法识别表格的大小

javascript - 如何使旋转木马 slider 图像响应