除了ID的元素

我正在寻找一个ID为tour_itinerary的side元素中的旅行路线,每个h1元素嵌套在其中,字体大小为1.2em,每个h2元素嵌套在其中,字体大小为0.9em em,并且每个段落嵌套在其中,字体大小为0.8em。

到目前为止,这是我的代码(尚未生效):

aside#tour_itinerary h1 {
  font-size: 1.2em;
}

aside#tour_itinerary h2 {
  font-size: 0.9em;
}

aside#tour_itinerary p {
  font-size: 0.8em;
}
  
  <header>
     <h1>Itinerary</h1>
  </header>
   <aside id="tour_itinerary">

  <h2>Day 1</h2>
  <p>We start from the foothills above Littleton,Colorado,promptly at 9am. The first day is a chance to get 
     your legs in shape,test your gearing,and prepare for 
     what's to come.
  </p>

  <h2>Day 2</h2>
  <p>Day 2 starts with a climb up Bear Creek Canyon to Lookout 
     Mountain,followed by a swift and winding descent into the 
     town of Golden. Refresh yourself at the famous Coors Brewery. 
  </p>

  <h2>Day 3</h2>
  <p>Day 3 takes you along the Peak to Peak Highway. This 
     55-mile route showcases the mountains of the Front Range,providing amazing vistas from Golden Gate Canyon State Park 
     to Rocky Mountain National Park.
  </p>  

  <h2>Day 4</h2>
  <p>Now for the supreme challenge: Day 4 brings some real 
     high-altitude cycling through Rocky Mountain National Park 
     and up Trail Ridge Road. It's an amazing ride,high above 
     timberline,topping out at over 11,000 feet.
  </p>

  <h2>Day 5</h2>
  <p>We start Day 5 on the west side of the Continental Divide. 
     From Grand Lake,you'll bike to Winter Park and then over 
     berthoud Pass,and back to the eastern side of 
     the Continental Divide.
  </p>

  <h2>Day 6</h2>
  <p>On Day 6,we ride 
     back to Littleton over Squaw Pass and Bear Creek and then
     enjoy a celebratory dinner as we share memories of a great
     tour.
  </p>
   </aside>

我想念什么?谢谢!

zengh225 回答:除了ID的元素

aside#tour_itinerary h1 {font-size: 1.2em;}

aside#tour_itinerary h2 {font-size: 0.9em;}

aside#tour_itinerary p {font-size: 0.8em;}
<body>
<aside id="tour_itinerary">
  <header>
    <h1>Itinerary</h1>
 </header>
    <h2>Day 1</h2>
    <p>We start from the foothills above Littleton,Colorado,promptly at 9am. The first day is a chance to get 
        your legs in shape,test your gearing,and prepare for 
        what's to come.
    </p>
    <h2>Day 2</h2>
    <p>Day 2 starts with a climb up Bear Creek Canyon to Lookout 
        Mountain,followed by a swift and winding descent into the 
        town of Golden. Refresh yourself at the famous Coors Brewery. 
    </p>
    <h2>Day 3</h2>
    <p>Day 3 takes you along the Peak to Peak Highway. This 
        55-mile route showcases the mountains of the Front Range,providing amazing vistas from Golden Gate Canyon State Park 
        to Rocky Mountain National Park.
    </p>  
    <h2>Day 4</h2>
    <p>Now for the supreme challenge: Day 4 brings some real 
        high-altitude cycling through Rocky Mountain National Park 
        and up Trail Ridge Road. It's an amazing ride,high above 
        timberline,topping out at over 11,000 feet.
    </p>
    <h2>Day 5</h2>
    <p>We start Day 5 on the west side of the Continental Divide. 
        From Grand Lake,you'll bike to Winter Park and then over 
        Berthoud Pass,and back to the eastern side of 
        the Continental Divide.
    </p>
    <h2>Day 6</h2>
    <p>On Day 6,we ride 
        back to Littleton over Squaw Pass and Bear Creek and then
        enjoy a celebratory dinner as we share memories of a great
        tour.
    </p>
</aside>  
</body>

好像您缺少aside标签以及该标签中的ID。可以通过使用以下标记包装所需的内容来解决此问题:

<aside id="tour_itinerary">
...content here ...
</aside>

根据给出的html和说明,您可以将<aside id="tour_itinerary">放在<header>上方或</header>下方。然后是最后一个</aside>下方的</p>

本文链接:https://www.f2er.com/3076889.html

大家都在问