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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <!DOCTYPE html>
<html>
  <head>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap" rel="stylesheet">
    <title>Mahatma Gandhi - Tribute Page</title>
  </head>
  <body>
    <div id="main">
      <h1 id="title">Mahatma Gandhi</h1>
      <div id="img-div">
        <figure id="img-fig">
        <img src="https://images.newindianexpress.com/uploads/user/imagelibrary/2019/10/6/w900X450/GANDHIAN12.jpg" id="image">
          <figcaption id="img-caption">Photograph of Mahatma Gandhi</figcaption>
        </figure>
      </div>
      <div id="tribute-info">
        <h2><i>~ Early Life ~</i></h2>
        <p>Mohandas Karamchand Gandhi is born in Porbandar on the northwest coast of India. His parents are not educated but are well off compared to others in their village, which allows them to provide a good education for their son. At the age of 13, Gandhi marries 14 year-old Kasturbai Makhanji. Following the customs of their region, the children are part of an arranged marriage. They will have four children together. Gandhi begins studies at University College London. He studies Indian law and also joins the Vegetarian Society while there. Gandhi avoids eating meat or drinking alcohol throughout his life.</p>
        <h2><i>~ Later in life ~</i></h2>
        <p>After completing his studies, Gandhi returns to India to start a law practice in Bombay. However, too shy to speak up in court, Gandhi's attempts to be a lawyer fail and he accepts various other jobs in legal firms. Gandhi agrees to travel to South Africa to help a Muslim Indian law firm with a lawsuit. He is shocked by the racial discrimination he finds there when he learns he is not allowed to travel in the first class section of the train. The trip becomes a major turning point for him as he devotes his life to the pursuit of equality and justice. <hr> In 1894, the day he is due to return to India, Gandhi learns about a bill that would deny Indians the right to vote. With no opposition to it, Gandhi's friends convince him to stay for another month to fight the bill. Gandhi ends up staying in South Africa for 20 years. Realizing that he is going to be staying in South Africa, Gandhi returns to Bombay to get his wife and children so he can bring them to South Africa. When their ship arrives at Port Natal in South Africa, a mob of angry white men, angry that he is stirring up trouble among the Indians, refuse to let Gandhi's family into the country. A local police superintendent helps Gandhi and his family leave the ship safely and he refuses to press charges on the mob. <hr> When the Transvaal government announces that all Indians must register and produce identification on demand or risk deportation, Gandhi asks Indians to peacefully resist. The Indians agree, setting off seven years of protest and struggle between the Indians and government. Among the first to see the court magistrate for his refusal to register with the government in South Africa, Gandhi is arrested and spends all of his time in prison reading. When he is arrested later that year, he reads "Civil Disobedience" by Henry David Thoreau and is even more committed to peaceful resistance. Having returned to India as a hero in 1915, Gandhi leads the movement to break away from Great Britain. He publishes the Declaration of Independence of India, representing the Indian National Congress, and makes his case for Indian independence. <hr> Gandhi is approached by Nathuram Vinayuk Godse, a Hindu nationalist. Gandhi blesses him and the man then shoots and kills him for being too sympathetic to the Muslims. Godse is wrong in his belief that killing Gandhi will lead to war that will eliminate Muslims. Instead, mourning over Gandhi's death leads to peace.</p>
      <p id="mg-quote"><i>"An eye for an eye only ends up making the whole world blind."</i> <i id="quote-name">-Mahatma Gandhi</i></p>
      </div>
    <div id="more-info"><strong>You can read more about Mahatma Gandhi, his life, teachings and writings <a href="https://en.wikipedia.org/wiki/Mahatma_Gandhi" target="_blank" id="tribute-link">here</a>.</strong></div>
    </div>
  </body>
</html>
              
            
!

CSS

              
                body {
  font-family: 'Noto Serif', serif;
  font-size 14px;
}

h2 {
  text-align: center;
  margin-bottom: -5px;
}

#main {
  background: hsl(63, 84%, 92%);
  border-radius: 20px;
  margin: 25px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

figcaption {
  text-align: center;
  margin-top: 7px;
}

#image {
display: block;
max-width: 100%;
height: 550px;
box-shadow: 9px 3px 12px -5px rgba(0,0,0,0.75);
}

#tribute-info{
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 50px;
  margin-left: 90px;
  margin-right: 90px;
}

#tribute-info p {
}

#mg-quote {
  width: 550px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#quote-name {
  display: flex;
  align-self: flex-end;
}

#more-info {
  margin-top: 3rem;
  font-size: 18px;
}

@media (max-width: 1366px) {
  #image {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 9px 3px 12px -5px rgba(0,0,0,0.75);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console