Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<head>
   <title>
    Nelson Mandela - tribute page
  </title>
</head>
<main id="main">
  <h1 id="title">
    Nelson Mandela 
  </h1>
  <p>
    Human rights activist and Nobel Prize winner
  </p>
<div id="img-div">
  <img id="image" src="https://images.unsplash.com/photo-1512844417531-fd0e4fc0af27?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8bmVsc29uJTIwbWFuZGVsYXxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" alt="Nelson Mandela graffiti">
  <p id="img-caption">
    Nelson Mandela graffiti in Hermanus, South Africa, fot. John-Paul Henry
  </p>
  </div>
   <h1>
      Some facts from Mandela's life:
    </h1>
  <section id="tribute-info">
    <h2>Childhood</h2>
    <ul>
      <li>Nelson Mandela was born into the Thembu royal family in Mvezo on 18 July 1918</li>
      <li>When he was born, his name was Rolihlahla Mandela and his birth name means "to pull a branch off a tree" and "troublemaker."</li>
      <li>Nelson was the youngest son of Mphakanyiswa, who had four wives and thirteen children (four boys and nine girls).</li>
      <li>Mphakanyiswa served as a counselor to Jongintaba Dalindyebo, the acting king of South Africa's Thembu tribe.</li>
      <li>After his father's death, Nelson became the ward of Jongintaba and was raised in the acting king's palace.</li>
    </ul>
      <h2>Education and Early Career</h2>
    <ul>
      <li>Mandela was given the name Nelson as a seven-year-old student in a Qunu primary school. (It was customary for schoolchildren to be given Christian names).</li>
      <li>After completing secondary school, he enrolled in Fort Hare Missionary College to seek a B.A. degree.</li>
      <li>He was thrown out of Fort Hare in 1940 for organizing a strike against the white rule of the college.</li>
      <li>He earned his B.A. degree in 1943 from Fort Hare, though he completed his coursework through the University of South Africa.</li>
      <li>He then studied law at the University of Witwatersrand. He earned a two-year diploma in law (which allowed him to practice law) but did not earn an LLB degree.</li>
      <li>In 1944, Mandela joined the African National Congress (ANC) and played a pivotal role in forming the ANC Youth League.</li>
      <li>In 1952, he became leader of the Defiance Campaign, speaking out through civil disobedience against South Africa's unjust apartheid practices.</li>
      <li>Also in 1952, he and Tambo (his friend from Fort Hare) formed Mandela & Tambo, South Africa's first Black-owned law firm.</li>
      <li>He was arrested and tried several times for his activism against the country's unjust system of racial segregation.</li>
    </ul>
      <h2>Mandela's Imprisonment</h2>
    <ul>
      <li>In 1964, Nelson Mandela was sentenced to life in prison. He served 27 years of that sentence before being released in 1990.</li>
      <li>He was imprisoned on Robben Island for 18 years before being moved to two other South African prisons.</li>
      <li>In 1968, both his mother and son passed away. However, he was not permitted out of prison to attend their funerals. His only son passed away due to AIDS.</li>
      <li>During his time in prison, he was able to have secret talks with F. W. de Klerk, the President of South Africa. Due to these talks, he was able to be freed.</li>
      <li>In 1989, toward the end of his time in prison, Mandela earned his LLB degree from the University of South Africa.</li>
      </ul>
      <h2>From Prison to South Africa's Presidency</h2>
    <ul>
      <li>Upon his release from prison, Mandela quickly rose to a leadership role in the African National Conference (ANC), then was elected to serve as president of South Africa.</li>
      <li>He was elected Deputy President of the ANC in 1990.</li>
      <li>In 1992, he was elected President of the ANC.</li>
      <li>In 1993, Mandela shared the Nobel Peace Prize with F.W. de Klerk. They received this Nobel Peace Prize for getting rid of the apartheid system.</li>
      <li>
        In 1994, he became the first president of South Africa to be elected by a democratic election in which the African National Congress was allowed to participate.
      </li>
      <li>Once he was finished with his presidency, he became an advocate in support of people suffering from AIDS.</li>
    </ul>
    <p> Source: <a class="a" href="https://biography.yourdictionary.com/articles/nelson-mandela-facts.html" target="_blank">https://biography.yourdictionary.com</a></p>
  </section>
  <section class="quote">
    <p>
       “I learned that courage was not the absence of fear, but the triumph over it. The brave man is not he who does not feel afraid, but he who conquers that fear.” - N. Mandela
    </p>
  </section>
  <footer>
    <p>
      More information about this remarkable man you can find <a class="a" href="https://en.wikipedia.org/wiki/Nelson_Mandela" id="tribute-link" target="_blank">here</a>.
    </p>
  </footer>
</main>
              
            
!

CSS

              
                #main {
  font-family: Roboto, sans-serif;
  color: #444;
}
#title {
  font-size: 2em;
  display: flex;
  justify-content: center;
  margin: 50px 25vw 30px;
  /*   padding: 7px;
  background-color: #ded; */
}
h1 + p {
  display: flex;
  justify-content: center;
  padding: 10px;
  margin: 0 15vw 40px 15vw;
  /*   background-color: #eee; */
  font-size: 1.1rem;
}
#img-div {
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: #eee;
  padding: 30px;
  margin: 2vw;
  border-radius: 20px;
}
#img-caption {
  color: #aba;
  margin-top: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}
#image {
  /*   display: block;  */
  width: 50vw;
  max-width: 100%;
  border: 4px solid #cdc;
  box-shadow: 5px 4px 7px 0px #aaa;
  border-radius: 10px;
  /*   margin: 0 auto;  */
}
#tribute-info {
  width: 85vw;
  font-size: 1.2rem;
  /*   margin: 0 auto 0 auto; */
  /*   text-align: center; */
}
div + h1,
li {
  margin: 30px 5vw 20px 18vw;
}
ul + p {
  margin: 30px 10vw 20px 18vw;
}
h2 {
  margin: 50px 20vw;
  font-size: 1.3em;
  text-decoration: underline;
}

.quote {
  font-style: italic;
  font-size: 1.2em;
  background-color: #bbe;
  width: 25vw;
  margin: 0 auto;
  padding: 2%;
  border-radius: 5px;
}
footer {
  background-color: #eee;
  padding: 7px;
  margin: 0.7vw;
  border-radius: 5px;
}
footer p {
  font-size: 1.2rem;
  text-align: center;
}
.a {
  text-decoration: none;
  color: #66f;
}
.a:hover {
  color: #aae;
}

@media (max-width: 600px) {
  h1,
  h2,
  li,
  .quote,
  footer,
  h1 + p {
    margin: 5px auto;
    width: auto;
    text-align: center;
  }
  #img-caption {
    text-align: center;
    font-size: 1em;
  }
  div + h1 {
    font-size: 1.6em;
    margin: 15px auto;
    width: auto;
    text-align: center;
  }
  #tribute-info,
  li {
    margin: 20px auto;
    width: auto;
    text-align: left;
    font-size: 1em;
  }
  ul + p {
    margin: 0 auto;
  }
  .quote,
  footer p {
    font-size: 1rem;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console