HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<link href="https://fonts.googleapis.com/css2?family=Recursive:wght@600&display=swap" rel="stylesheet">
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js" type="text/javascript">
</script>
<main id="main">
<h1 id="title">Mahatma Gandhi</h1>
<p class="subtitle"><em>The warrior of peace</em></p>
<div id="img-div">
<img id="image" alt="Picture of Mahatma Gandhi" src="https://static.toiimg.com/thumb/71402733.cms?width=680&height=512&imgsize=435681">
<figcaption id="img-caption"><em>
Mahatma Gandhi lovingly known as Gandhiji or Bapuji is considered as the father of the Indian Nation</em>
</figcaption>
</div>
<div id="tribute-info">
<h2>Who Was Gandhi?</h2>
<p>Mohandas Karamchand Gandhi (2 October 1869 – 30 January 1948) was an Indian lawyer, anti-colonial nationalist, and political ethicist, who employed nonviolent resistance to lead the successful campaign for India's independence from British Rule, and in turn inspired movements for civil rights and freedom across the world. The honorific Mahātmā (Sanskrit: "great-souled", "venerable"), first applied to him in 1914 in South Africa, is now used throughout the world.</p>
<h3>Here's A Timeline Of Gandhiji's Life</h3>
<ul>
<li><strong>1869:</strong> Birth at Porbandar</li>
<li><strong>1882:</strong> Marriage with Kasturba, aged 13</li>
<li><strong>1888:</strong> Reached Southampton, England</li>
<li><strong>1893:</strong> Reached Durban</li>
<li><strong>1893:</strong> Refused to remove his Paghasdi; left the court</li>
<li><strong>1893:</strong> Thrown off the first class carriage of the train at Pietermartizburg Station</li>
<li><strong>1894:</strong> Founded the 'Natal Indian Congress'</li>
<li><strong>1899:</strong> Established Indian ambulance during the Anglo-Boer War</li>
<li><strong>1906:</strong> Took the vow of Brahmacharya</li>
<li><strong>1906:</strong> Advent of Satyagraha at Empire Theatre, Johannesburg, where people took a pledge with god as their witness, to oppose the Black Act</li>
<li><strong>1906:</strong> Advent of Satyagraha at Empire Theatre, Johannesburg, where people took a pledge with god as their witness, to oppose the Black Act</li>
<li><strong>1906:</strong> Left for England as the member of the Indian delegation</li>
<li><strong>1907:</strong> Asiatic registration bill passed in Transvaal Parliament</li>
<li><strong>1908:</strong> The term 'Satyagraha' adoptedbased on Maganlal Gandhi's formulation 'Sadagraha' </li>
<li><strong>1908:</strong> Awarded two months simple imprisonment for refusal to obtain registration</li>
<li><strong>1908:</strong> Mir Alam and others assault Gandhiji</li>
<li><strong>1908:</strong> Breach of fire and bonfire of certificate</li>
<li><strong>1908:</strong> Awarded two months rigourous for entry into the Transvaal without permit</li>
<li><strong>1909:</strong> 'Hind Swarajya' published in 'Indian Opinion'</li>
<li><strong>1910:</strong> Established Tolstoy Farm; vowed to eschew milk; commenced experiments in frutarian diet</li>
<li><strong>1912:</strong> Gopalkrishna Gokhale's South Africa tour commenced</li>
<li><strong>1913:</strong> Kasturba arrested and given 3 months rigorous imprisonment</li>
<li><strong>1914:</strong> Indians relief bill passed</li>
<li><strong>1915:</strong> Visited Shantiniketan</li>
<li><strong>1916:</strong> Lectured at Benaras Hindu University</li>
<li><strong>1917:</strong> Sabaramati Ashram established</li>
<li><strong>1916:</strong> Met Jawaharalal Nehru for the first time at Lucknow Congress</li>
<li><strong>1918:</strong> Appointed to arbitar the dispute between Mill-owners and Mill-hands of Ahmedabad</li>
<li><strong>1918:</strong> Indefinite fast to keep the resolve of striking </li>
<li><strong>1918:</strong> Broke fast after compromise</li>
<li><strong>1919:</strong> Satyagraha pledged against 'Rowlett Act'</li>
<li><strong>1919:</strong> Arrested at Palwal Station</li>
<li><strong>1919:</strong> Massacre at Jalianwala Bagh; three days' fast in Ahmedabad commenced</li>
<li><strong>1919:</strong> First issue of 'Young India' published</li>
<li><strong>1919:</strong> Congress boycotts Hunter Commision and set up independent inquiry</li>
<li><strong>1920:</strong> Commencement of Non-Cooperation</li>
<li><strong>1921:</strong> Given the reigns of Congress in Ahmedabad</li>
<li><strong>1922:</strong> Bardoli Taluka resolved against payment of land revenue and Civil-Disobedience</li>
<li><strong>1922:</strong> Policemen at Chauri Chaura killed</li>
<li><strong>1922:</strong> Gandhiji and Shankerlal Banker arerested</li>
<li><strong>1922:</strong> Trial held at Ahmedabad Circuit House; Judge Broomfield awarded Gandhiji a sentence of six years' imprisonment</li>
<li><strong>1924:</strong> Presided over Belgaum Congress</li>
<li><strong>1925:</strong> The publication of the autobiography "The Experiments With My Truth" commences in Young India</li>
<li><strong>1928:</strong> Boycott of Simon Commission</li>
<li><strong>1929:</strong> Viceroy Lord Irwin announces ound Table conference</li>
<li><strong>1930:</strong> Dandi march commences from Satyagraha Ashram</li>
<li><strong>1930:</strong> Broke the Salt Law</li>
<li><strong>1930:</strong> Arrested and sent to Yeravda Prison</li>
<li><strong>1931:</strong> Realeased from prison</li>
<li><strong>1931:</strong> Gandhi-Irwin pact signed</li>
<li><strong>1931:</strong> In Londom as the sole representative of Conress in the Round Table Conference</li>
<li><strong>1931:</strong> Gandhi-Irwin pact signed</li>
<li><strong>1931:</strong> Declared his opposition to the proposed Communal Award</li>
<li><strong>1931:</strong> Second Round Table Conference ends</li>
<li><strong>1932:</strong> Broke the fast</li>
<li><strong>1932:</strong> Harijan Sevak Sangh established</li>
<li><strong>1933:</strong> Commenced publication of "Harijan"</li>
<li><strong>1933:</strong> Commenced fast and released from prison</li>
<li><strong>1933:</strong> Arrested at Ahmedabad</li>
<li><strong>1933:</strong> Sabarmati Ashram given to HSS</li>
<li><strong>1934:</strong> Withdrew collective Satyagraha</li>
<li><strong>1934:</strong> Resigned from Congress</li>
<li><strong>1939:</strong> Wrote a letter to Adolf Hitler</li>
<li><strong>1942:</strong> Advised the Cripps Commisiion to return to England</li>
<li><strong>1943:</strong> Commenced a 21-day fast</li>
<li><strong>1946:</strong> Communal Riots in Calcutta</li>
<li><strong>1946:</strong> Communal violence in Noakhali</li>
<li><strong>1947:</strong> Barefoot march to Noakhali commences</li>
<li><strong>1947:</strong> Tour of Bihar</li>
<li><strong>1947:</strong> The Congress, Muslim League and Sikhs accept the partition</li>
<li><strong>1947:</strong>Met Mountbatten</li>
<li><strong>1947:</strong> The Congress Working Committee adopted resolution to accept partition</li>
<li><strong>1947:</strong> Reached Delhi</li>
<li><strong>1947:</strong> India got Indipendence in August 15</li>
<li><strong>1947:</strong> A bomb thrown during prayer meeting</li>
<li><strong>1947:</strong> Took three bullets on his chest. Godse the assasin</li>
<li><strong>1948:</strong> Cremated on the banks of Yamuna by Ramdas</li>
</ul>
<blockquote>
<p><em>"Live as if you were to die tomorrow. Learn as if you were to live forever."</em></p>
<cite>--Mahatama Gandhi</cite>
<h3><a id="tribute-link" href="https://en.wikipedia.org/wiki/Mahatma_Gandhi" target="_blank">Click to know more about the GREAT MAN</a></h3>
</blockquote>
</div>
</main>
<footer><em>Coded by Devnarayan.R</em></footer>
html {
font-size: 20px;
color: #263238;
}
body {
@import url(https://fonts.googleapis.com/css?family=Open + Sans);
font-family: OpenSans, Arial, sans-serif;
font-size: 1.6rem;
line-height: 1.5;
text-align: center;
background-color: #8fbc8f;
margin: 0;
}
figcaption {
color: black;
}
img {
max-width: 100%;
display: block;
height: auto;
margin: 0 auto;
}
#img-div {
background: white;
padding: 10px;
margin: 0 auto;
width: 30vw;
}
ul {
text-align: left;
max-width: 550px;
margin: 0 auto 50px auto;
line-height: 1.6;
}
#img-caption {
font-size: 1.4rem;
}
footer {
font-family: courier;
font-size: 50px;
color: #3e2723;
}
a {
font-family: sans-serif;
}
#tribute-info {
padding: 12px;
}
blockquote {
color: black;
font-family: "Recursive", sans-serif;
}
#title {
margin-bottom: 0px;
}
.subtitle {
margin-top: 0px;
font-weight: 100;
}
Also see: Tab Triggers