Tribute Page - Build a Tribute Page UL - Li

Tell us what’s happening:
Hi, I’d like to make the content (li) on the timeline (ul) show as an inline-block so that it displays next to the corresponding year. I’ve tried creating an additional class, adding a span, and styling the ul > li. All to no avail. Any advice on how to style these properly would be greatly appreciated. Thanks! *Note: I am aware that the spans and additional class are not included on all the li items. I was just experimenting to find a solution then will apply it to all.

Your code so far

HTML
  <ul id="tribute-info">
        <li><p class="bold"><span class="timeline-content">1914</p>- Born in Cresco, Iowa</span></li>
        <li><p class="bold">1933</p> - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"</li>
        <li><p class="bold">1935</p> - Has to stop school and save up more money. Works in the Civilian Conservation Corps, helping starving Americans. "I saw how food changed them", he said. "All of this left scars on me."</li>
        <li><p class="bold">1937</p> - Finishes university and takes a job in the US Forestry Service</li>
        <li><p class="bold">1938</p> - Marries wife of 69 years Margret Gibson. Gets laid off due to budget cuts. Inspired by Elvin Charles Stakman, he returns to school study under Stakman, who teaches him about breeding pest-resistent plants.</li>
        <li><p class="bold">1941</p> - Tries to enroll in the military after the Pearl Harbor attack, but is rejected. Instead, the military asked his lab to work on waterproof glue, DDT to control malaria, disinfectants, and other applied science.</li>
        <li><p class="bold">1942</p> - Receives a Ph.D. in Genetics and Plant Pathology</li>
        <li><p class="bold">1944</p> - Rejects a 100% salary increase from Dupont, leaves behind his pregnant wife, and flies to Mexico to head a new plant pathology program. Over the next 16 years, his team breeds 6,000 different strains of disease resistent wheat - including different varieties for each major climate on Earth.</li>...
        <li><p class="bold">2009</p> - dies at the age of 95.</li>
      </ul>

CSS

.timeline-content{

display:inline-block;
}

ul > li{
display:inline-block;
}

span{
display:inline-block;
}```




WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36</code>

**Challenge:**  Tribute Page - Build a Tribute Page

**Link to the challenge:**
https://www.freecodecamp.org/learn/2022/responsive-web-design/build-a-tribute-page-project/build-a-tribute-page

one thought: why use a p element for the years? I would use span for the years and span for the text next to it. (I believe p is a ‘block-level’ element so it likes to have the whole line when possible)

That worked ! I thought of using a span but didn’t think of using two spans per list item. Thank you!

1 Like