30

总之按二十一主题。我想更改标题的大小当我将标题包裹在 h1 和 h2 标签周围时,如下所示

<h1>My h1 heading </h1> 
<h2> My h2 heading </h2>

我使用的主题中标题的字体大小与内容的字体几乎相同,只是它们是粗体。所以我的标题不是很突出。

我想我需要更改 css 文件中的某些内容。请告知具体需要放入什么。

谢谢,

4

5 回答 5

45
h1 {
  font-weight: bold;
  color: #fff;
  font-size: 32px;
}

h2 {
  font-weight: bold;
  color: #fff;
  font-size: 24px;
}

请注意,在颜色之后您可以使用单词(例如white)、十六进制代码(例如#fff)或 RGB(例如rgb(255,255,255))或 RGBA(例如rgba(255,255,255,0.3))。

于 2012-05-19T19:07:14.323 回答
14
 h1 { font-size: 150%; }
 h2 { font-size: 120%; }

根据需要进行调整。

于 2012-05-20T10:23:47.883 回答
6

你试过什么?这应该有效。

h1 { font-size: 20pt; }
h2 { font-size: 16pt; }
于 2012-05-19T19:07:18.490 回答
1

如果您想专门更改标题,这是一个更简单的解决方案

<style>
    h1.increase {
       font-size: 15px;
}
</style>

<h1 class="increase">Header</h1>
于 2021-04-01T21:07:48.660 回答
0

如果您只更改字体大小,文本可能会在较小的设备类型上相交。

<style>
.heading-1{
  font-size: 350%!important;
}
</style>

<h1 class="heading-1">
  Get in Touch
</h1>

在此处输入图像描述

为了使其响应,请考虑调整行高。

<style>
.heading-1{
  font-size: 350%!important;
  line-height: 120%!important;
}
</style>

<h1 class="heading-1">
  Get in Touch
</h1>

在此处输入图像描述

于 2021-09-05T08:51:57.423 回答