为什么我的h1,h2,p不能使用我的字体大小

问题描述 投票:0回答:1

我正在为“关于我”页面编写代码。我为布局的列使用了类。我不确定为什么不能调整字体大小的大小,但可以调整代码中的其他所有内容。

我尝试过:

h1 { 
    font-size: 13 px; ( also %, ems)
}

但是字体大小保持不变。

这是我的css文件:

h1 {
    font-size: 13px;
    font-family: helvetica, sans-serif;
    text-align: left;
    font-weight: bold;
    margin-top: 40px;
}

有人告诉我它可能与此有关(但我不知道是什么:):

<!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ABOUT ME: Kim Stahlbaum</title>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.css">
    <!-- Add all changes to the custom.css file only -->
    <link rel="stylesheet" href="css/custom2.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">  </script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    </head>
</html>

我的html看起来像这样:

<div class="column2of2">
      <h1>Who Am I?</h1>
        <p>Hi, my name is Kim, and I am a graphic designer with 10 years experience, emerging into the web design world. <br /> </p>
</div>
html css font-size
1个回答
0
投票

为什么不使用

.column2of2 h1{
  font-size: 13px !important;
}

!important覆盖样式并提高其首选项。

© www.soinside.com 2019 - 2024. All rights reserved.