Jump to content
  • 0

Использование псевдоклассов и псевдоэлементов


jejik
 Share

Question

И снова, здравствуйте.

 

Есть текст, разделенный на правую и левую часть (section id - соответственно), далее секции разделены на абзацы. Задача: в левой секции в первом абзаце первая строка должна быть напечатана большими буквами. Присвоить id абзацу я могу, 

 

 
  <p id="firstparagraph">            The Bike the Mountains Tour rises from the town of Littleton,             Colorado and explores the Colorado Front Range. Our tour             crosses the Continental Divide twice, giving you the             opportunity to bike the highest paved roads in the             United States. This tour is a classic showcase of Colorado's             Rocky Mountain scenery.         </p>

дальше вроде бы должен следовать следующий код css 

 

#firstparagraph ::first-line{text-transform: uppercase;}

но, во первых почему-то не работает, а во вторых есть ли возможность последовательного использования :first-child::first-line, без присвоения id абзацу?

 

Как так получается, что следующий код 

 

blockquote p :before {content: "\00ab"; }blockquote p :after{content: "\00bb"; }

вставляет кавычки не перед абзацем в целом, а только выделяет в кавычки одно из слов абзаца, которое в html выделено тэгами <i></i>?

Edited by jejik
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
#firstparagraph::first-line - нужно убрать пробел

не работает

 

А за кавычки спасибо, теперь стоят там, где требовались.

 

 

<section id="leftsection">         <p id="firstparagraph">            The Bike the Mountains Tour rises from the town of Littleton,             Colorado and explores the Colorado Front Range. Our tour             crosses the Continental Divide twice, giving you the             opportunity to bike the highest paved roads in the             United States. This tour is a classic showcase of Colorado's             Rocky Mountain scenery.         </p>         <blockquote>            <p>The Bike the Mountains Tour is <i>amazing</i>. I highly                recommend it and would gladly return.            </p>            <cite>— Steve H.</cite>         </blockquote>                       <p>Not designed for the weekend cyclist, this tour is offered             only for those fit enough to ride high mountain passes. We             provide sag wagons and support. Your lodging and meals are             also part of the registration fee.            We guarantee tough climbs, amazing sights, sweaty jerseys,             and lots of fun.         </p>         <p>This is the seventh year we've offered the Bike the Mountains             Tour. It is our most popular tour and riders are returning             again and again. Our experienced tour leaders will be there             to guide, help, encourage, draft, and lead you            every stroke of the way. Come join us!         </p>      </section>      <section id="rightsection">         <h1>Itinerary</h1>         <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>      </section>

вот весь кусочек кода, необходимо написать первую строчку первого абзаца левой секции большими буквами. Id="firstparagraph" вписала в html уже я, скорее всего задачу требуется решить без этой преписки.

Edited by jejik
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy