某些部分的文字大小错误且没有空白

时间:2018-10-13 03:58:34

标签: html css

我正在为一个课程创建一个网页(是的,我知道,现在让我活着),但是页面的某些部分格式不正确。我已经重新键入,重新编写并查看了我的代码,但是在我生命中,我无法确定为什么它的格式不正确。

基本上,包装器中的所有文本的两边应有10px的空白,只有此部分没有。其余的应用了相同的样式,具有相同的规则,没有明显的差异,并且工作正常。但是此部分的文字大小错误,并且两侧没有10px的空白。

代码如下。我将它放在带有样式表的div包装器中:

.wrapper {
  width: 960px;
  margin: 0 auto;
  text-overline-color: #356618;
  background-color: white;
}

body {
  margin: 10 10 10 10;
  background-color: #DAEAD0;
  font-family: verdana, geneva, sans-serif;
}

header {
  text-align: center;
  background-color: #FFA500;
}

footer {
  text-align: center;
  font-size: 87.5%;
  background-color: #FFA500;
}

.custom {
  color: #836145;
  font-size: 125%;
  text-shadow: 2px 2px 3px #8C8C8C;
  margin=10px;
}

.custom2 {
  color: #356618;
  font-size: 87.5%
}
<h2 class="custom">Description</h2>
<p class="custom2">
  Kumquats have been called "the little gold gems of the citrus family". They are believed to be native to China and were included in the genus Citrus until about 1915 when Dr. Walter T. Swingle set them apart in the genus Fortunella (in honor of the British
  horticulturist, Robert Fortune who introduced the kumquat to Europe in 1846). Kumquats have a very distinctive taste. It is the only citrus fruit that can be eaten "skin and all." The peel is the sweetest part and can be eaten separately. The pulp contains
  the seeds and juice, which is sour. When eaten together, you get a sweet and sour taste which is unlike anything else. The seeds, however, should not be eaten. They are similar to the seed of the orange and have a distinctive green color. The seeds
  also contain pectin, which can be removed by boiling for use in making jams and jellies.</p>

<h2 class="custom">Varieties</h2>
<p class="custom2">
  There exist several cultivars of kumquat; however, only four of them are grown widely for their fruits.
  <ul class="custom2">
    <li>Nagami (Fortunella margarita): The fruit is oval and is the most common variety grown inside the USA. It features a smooth, light yellow peel and has a tart flavor.
    </li>
    <li>Marumi (Fortunella japonica): The fruit is round, and has a distinctive sweet taste and pleasant flavor.
    </li>
    <li>Meiwa (Fortunella crassifolia): It is round in shape, and larger than other verities. It is popular in Japan by name ninpo or neiha kinkan.
    </li>
    <li>Hong Kong Wild (Fortunella hindsii): They are the smallest sized kumquats.
    </li>

</p>

2 个答案:

答案 0 :(得分:1)

在正文选择器中,您留出了边距大小后的px。另外,由于周围的边距均为10px,因此您可以将其写为margin:10px;然后在自定义类选择器中,在边距后放置=而不是冒号:

答案 1 :(得分:0)

尝试一下,我修复了一些错别字和10px的填充

.wrapper {
width: 960px;
margin: 10px auto;
text-decoration-color: #356618;
background-color: white;
padding: 10px;


}



body {
margin: 10px;
background-color: #DAEAD0;
font-family: verdana, geneva, sans-serif;


 }



 header {
text-align: center;
background-color: #FFA500;


 }



 footer {
text-align: center;
font-size: 87.5%;
background-color: #FFA500;


 }



.custom {
color: #836145;
font-size: 125%;
text-shadow: 2px 2px 3px #8C8C8C;
margin:10px;


 }


  .custom2 {
color: #356618;
font-size: 87.5%

}