Help with the tribute page (Responsive Design)

somehow i managed to finish the test but there is something bothering me and i dont know how to fix it. when i change the viewport ( minimize the window ) my whole list is moving out of sight. it just should stay in the middle of the page like the rest of it.
maybe somebody could take a look at my already devasted code ?


This is how it looks like

Your code so far
CSS complete:
#main {
text-align:center;
font-family: Arial;
letter-spacing: 1px;
background-color: lightgrey;
margin: 30px 0px 30px 0px;
border-radius: 5px;
}

#title {font-size:50px;}

#img-div {
background-color: white;
margin: 5px 10px 5px 10px;
}

#image {
max-width: 100%;
height: auto;
}

#img-caption {
font-family: Arial;
font-size: 15px;
padding: 15px 0px 15px 0px;
}

#tribute-info{
max-width: 100%;
height: auto;
text-align: left;
padding: 0px 650px 0px 650px;
}

li {margin: 0px 0px 15px 0px;}

p {font-size:15px;
text-align:left;
margin: 0 auto;
padding: 0px 700px 0px 650px;
}

h2 {font-size:15px;}
h3 {font-size:20px;}

#tribute-link {font-size: 17px;}

HTML (just the list):

  • 1914 - Born in Cresco, Iowa
  • 1933 - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"
  • 1935 - 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."
  • 1937 - Finishes university and takes a job in the US Forestry Service
  • 1938 - 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.
  • 1941 - 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.
  • 1942 - Receives a Ph.D. in Genetics and Plant Pathology
  • 1944 - 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.
  • 1945 - Discovers a way to grown wheat twice each season, doubling wheat yields
  • 1953 - crosses a short, sturdy dwarf breed of wheat with a high-yeidling American breed, creating a strain that responds well to fertilizer. It goes on to provide 95% of Mexico's wheat.
  • 1962 - Visits Delhi and brings his high-yielding strains of wheat to the Indian subcontinent in time to help mitigate mass starvation due to a rapidly expanding population
  • 1970 - receives the Nobel Peace Prize
  • 1983 - helps seven African countries dramatically increase their maize and sorghum yields
  • 1984 - becomes a distinguished professor at Texas A&M University
  • 2005 - states "we will have to double the world food supply by 2050." Argues that genetically modified crops are the only way we can meet the demand, as we run out of arable land. Says that GM crops are not inherently dangerous because "we've been genetically modifying plants and animals for a long time. Long before we called it science, people were selecting the best breeds."
  • 2009 - dies at the age of 95.

Your browser information:

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

Challenge: Build a Tribute Page

Link to the challenge:

Hi!

I was just working on my own Tribute Page :grin: I was wondering if it might be because of the 650px and 700px values you have for the padding of the tribute-info and p elements?

I fixed mine by adding a media query for smaller screens that adjusted the paddings for much smaller values. It fixed it I think but I don’t know if that’s the proper way of doing it. Could be worth a try? :slight_smile:

It would really be so much easier to help you if you gave us a link to your project instead of pasting the code here.

Already tried to erase the padding before. Unfortunately without padding the bullets just stay on the left border an wont move.
Going to try your solution with Media query this evening :+1:

Sorry, Iam new to this. Going to try Ines solution First. If Media query doesnt Work i will send my link

If you do not wish to share the codepen link to the project, Cut and paste both the HTML and CSS in full, not just the section with the bulletpoints.

After you have cut and pasted, please format the code using the following method:


To share code, you can use the Preformatted text button.
This allows you to share raw code:


Just select the code that you want to keep raw, and press the button.

top

The image on the right is raw code.

valuable tip. thx :+1:

tried another few thing - didnt work either

Why do you need to use positioning on the list?

position: relative;
left: 600px;
padding-right: 1200px;

What are you trying to accomplish with this? What happens if you remove all three of these properties?

the first two properties are my second option to move the bullets into the middle of the page. otherwise they stay on the left side. padding-right is for pushing the now inserted text back to the middle

I don’t think I understand. Why do you want the bullets to be in the middle of the page? And do you really want the list content to only be a few words wide? This isn’t usually the way lists are displayed. Don’t you think it makes the list hard to read?

my objective was to create a perfect copy of this page: https://codepen.io/freeCodeCamp/full/zNqgVx

The bullets in that example aren’t in the middle of the page. The width of the list is restricted and then the entire list is centered on the page. There are CSS properties that allow you to restrict the width of an element. I would recommend you set a max width instead of a width. And then there are a variety of ways to center elements on the page.

1 Like

Finally. Combination: margin: 0 auto; max-width:550px; is the right way to do it. Thank you very much for helping me out :smiley: :+1:

I would suggest you use rem units instead of px. That way the width will grow if the user manually increases the font size, keeping the number of characters per line approximately the same.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.