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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<header>
<div class="heading">
<h1>Street Food India</h1>
</div>
<div class="lead-image">
<img src="images/spicy.png" alt="lead image">
</div>
</header>
<div class="wrapper">
<section class="single-item">
<article class="item1 single-item-image">
<img src="http://keeprecipes.com/sites/keeprecipes/files/pani_puri.jpg" alt="">
</article>
<div class="single-item-aside">
<article class="item1 single-item-recipe">
<span>Recipe: </span><br>Boiled potatoes are mixed with chopped onion with coriander leaves, cumin powder, chaat masala and salt... <br><a href="http://foodviva.com/snacks-recipes/pani-puri/">Read Full</a>
</article>
<article class="item1 single-item-location"><span>Famous </span>throughout length and breadth of India including major cities like New Delhi, Mumbai, Kolkata, Chennai, Pune, Hyderabad, Patna, Lucknow, Jaipur and every city or town.</article>
</div>
<article class="item1 single-item-name">
<span>Pani Puri </span>consists of a round, hollow puri, fried crisp and filled with a mixture of flavored water (commonly known as imli pani), tamarind chutney, chili, chaat masala, potato, onion and chickpeas.
</article>
</section>
<section class="single-item">
<article class="item2 single-item-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Aloo_Tikki_served_with_chutneys.jpg/1200px-Aloo_Tikki_served_with_chutneys.jpg" alt="Aloo Tikki">
</article>
<div class="single-item-aside">
<article class="item2 single-item-recipe">
<span>Recipe: </span><br>Steam or pressure cook potatoes and mash them. Add the spice poders, salt, corn starch and coriander leaves...<br><a href="http://foodviva.com/snacks-recipes/spicy-aloo-tikki-recipe/">Read Full</a>
</article>
<article class="item2 single-item-location">
<span>Famous </span>in North Indian Cities like New Delhi, Mumbai,Chandigarh, Lucknow, Kanpur, Varanasi, Bhopal, Indore, Ahemdabad, Jaipur, Bikaner, Pune etc but can be found in every city or town. </article>
</div>
<article class="item2 single-item-name">
<span>Aloo Tikki </span>made out of boiled potatoes, onions and various curry spices. It is served hot and warm along with a side of saunth, tamarind and coriander-mint sauce, and sometimes yogurt or chick peas.
</article>
</section>
<section class="single-item">
<article class="item3 single-item-image">
<img src="https://media-cdn.tripadvisor.com/media/photo-s/09/96/b5/e4/flambe-hospitality.jpg" alt="">
</article>
<div class="single-item-aside">
<article class="item3 single-item-recipe">
<span>Recipe: </span><br>Take 2 cups of wheat flour, 1/4 teaspoon salt and 1 teaspoon of ghee or oil.Add water and knead to a smooth soft dough...<br><a href="#0">Read Full</a>
</article>
<article class="item3 single-item-location">
<span>Famous </span>in the states of Bihar, West Bengal, Jharkhand and Uttar Pradesh including major cities like PAtna, Lucknow, Kolkata, Ranchi, Varanasi, Kanput, Allahabad etc but can be found in every city or town. </article>
</div>
<article class="item3 single-item-name">
<span>Litti Chokha </span>is a dough ball made up of whole wheat flour and stuffed with Sattu (roasted chickpea flour) mixed with herbs and spices and then roasted over coal or cow dung cakes or wood then it is tossed with lots of ghee.
</article>
</section>
<section class="single-item">
<article class="item4 single-item-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/2/20/Indian_cuisine-Chaat-Bhelpuri-03.jpg" alt="">
</article>
<div class="single-item-aside">
<article class="item4 single-item-recipe">
<span>Recipe: </span><br>Firstly, dry roast puffed rice till it becomes crisp. Add 2 tablespoon of coriander chutney, 1 teaspoon of tamrind dates chutney...<br> <a href="#0">Read Full</a>
</article>
<article class="item4 single-item-location">
<span>Famous </span>throughout India particularly metro cities such as New Delhi, Mumbai, Kolkata, Chennai, Pune, Hyderabad, Patna, Lucknow, Jaipur, Chandigarh, Varanasi, Bangalore and every city or town. </article>
</div>
<article class="item4 single-item-name">
<span>Bhel Puri </span> is a savoury snack, and is also a type of chaat. It is made of puffed rice, vegetables and a tangy tamarind sauce mixed together without any cooking or heating.
</article>
</section>
<section class="single-item">
<article class="item5 single-item-image">
<img src="http://cdn.walkthroughindia.com/wp-content/uploads/2011/10/Chole-Bhature.jpg" alt="Chole Bhature">
</article>
<div class="single-item-aside">
<article class="item5 single-item-recipe">
<span>Recipe: </span><br>Soak chickpeas in enough water overnight or for 7-8 hours. Drain the water and cook the chole with water + salt in a pressure cooker...<br><a href="#0">Read Full</a>
</article>
<article class="item5 single-item-location">
<span>Famous </span>in North India throughout the states of Punjab, Haryana, Uttrakhand, Rajasthan, Himachal Pradesh, Delhi and UP but found throughout India.</article>
</div>
<article class="item5 single-item-name">
<span>Chole Bhature </span>is a combination of chana masala (spicy chickpeas) and fried bread called bhatura made from maida flour (soft wheat). Chole is a spicy curry made from white chickpeas where as a Bhatura is a fried leavened bread. It is usually eaten as breakfast, sometimes accompanied with lassi.
</article>
</section>
<section class="single-item">
<article class="item6 single-item-image">
<img src="https://www.thebetterindia.com/wp-content/uploads/2016/11/idli-sambar.jpg" alt="Idli Sambar">
</article>
<div class="single-item-aside">
<article class="item6 single-item-recipe">
<span>Recipe: </span><br>Pressure cokk dal with 2 cup[s of water for 2 whistles. MAsh it and set aside. Soak tamarind in little hot water, squeeze and extract the pulp...<br><a href="#0">Read Full</a>
</article>
<article class="item6 single-item-location">
<span>Famous </span>in South India particularly cities like Chennai, Hyderabad, Bengaluru, Kanyakumari, Coimbatore, Vishakhapatnam, Mysore but can be found in every city or town. </article>
</div>
<article class="item6 single-item-name">
<span>Idli Sambar </span>is steamed and is high in protein and so is sambar, the concoction of lentils and veggies. The recipe is loaded with nutritious ingredients and is loved by people for their health benefits.
</article>
</section>
</div>
<footer>
© All the images to their respective Owners.<br><a href="https://www.twitter.com/viiv3k" target="_blank">Vivek</a> 2017.
</footer>
@import url('https://fonts.googleapis.com/css?family=Oswald:200&subset=latin-ext');
@import url('https://fonts.googleapis.com/css?family=Raleway');
*{
margin: 0;
padding: 0;
}
body{
font-family: 'Raleway', sans-serif;
font-size: 16px;
box-sizing: border-box;
}
header{
position: fixed;
z-index: 10;
background-color: #fff;
width: 100%;
font-family: 'Oswald', sans-serif;
color: #ec4300;
font-size: 2.5vw;
letter-spacing: 5px;
text-transform: uppercase;
padding: 0 2vw;
box-shadow: 0 0 10px rgba(0,0,0,.3);
display: -ms-grid;
display: grid;
-ms-grid-columns:10fr 2fr;
grid-template-columns: 10fr 2fr;
transition: all .5s ease-in-out;
}
.lead-image{
-ms-grid-row-align: center;
justify-self: center;
}
img[src="images/spicy.png"]{
display: block;
width: 8vw;
}
header:hover{
color: #007600;
}
header:hover img{
filter: hue-rotate(90deg);
}
.wrapper{
padding: 8.5vw .8vw 1vw;
font-size: 1em;
font-weight: 450;
display: -ms-grid;
display: grid;
-ms-grid-columns: repeat(auto-fit, minmax(500px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
grid-gap: .8vw;
}
.single-item{
display: -ms-grid;
display: grid;
-ms-grid-columns: repeat(2, minmax(50%, 50%));
grid-template-columns: repeat(2, minmax(50%, 50%));
grid-gap: .25vw;
}
.single-item-recipe, .single-item-location, .single-item-name{
padding: .5vw;
}
.single-item article > img{
display: block;
max-width: 100%;
min-height: 100%;
}
.single-item a{
text-decoration: none;
color: inherit;
font-weight: 700;
display: inline-block;
box-shadow: 0 0 10px rgba(0,0,0,.3);
padding: .2em;
float: right;
}
.single-item a:hover{
box-shadow: 0 0 10px rgba(0,0,0,.3) inset;
transform: scale(1.1);
}
.single-item span{
font-size: 1.5em;
font-weight: 600;
}
.single-item-name{
grid-column: 1 / span 2;
}
.single-item-aside{
display: -ms-grid;
display: grid;
grid-gap: .25vw;
}
.item1{
background-color: rgba(268, 168, 0, .7);
}
.item2{
background-color: rgba(60, 173, 50, .7);
}
.item3{
background-color: rgba(00,191, 255, .7);
}
.item4{
background-color: rgba(236, 70, 62, .7);
}
.item5{
background-color: rgba(240, 230, 140, 1);
}
.item6{
background-color: rgba(138, 43, 226, .6);
}
footer{
width: 100%;
font-family: 'Raleway', sans-serif;
color: initial;
font-size: 1em;
text-align: center;
padding: .5em 0;
box-shadow: 0 0 10px rgba(0,0,0,.3);
}
footer a{
text-decoration: none;
color: initial;
}
footer a:hover{
color: purple;
font-weight: 700;
}
.single-item{
opacity: 0;
background-color: #eee;
}
@media only screen and (min-width: 100px) {
.single-item{
opacity: 1;
transition: opacity 1s ease-in;
}
}
@media (min-width:700px) and (max-width: 1000px){
header{
font-size: 3vw;
}
.wrapper{
padding-top: 10vw;
}
}
@media (min-width: 500px) and (max-width: 700px){
header{
font-size: 3.5vw;
}
.wrapper{
padding-top: 12vw;
font-size: .9em;
}
img[src="images/spicy.png"]{
display: block;
width: 11vw;
}
}
@media (max-width: 500px){
header{
font-size: 4vw;
}
.wrapper{
grid-template-columns: repeat(auto, 1fr);
padding-top: 15vw;
font-size: .9em
}
img[src="images/spicy.png"]{
display: block;
width: 14vw;
}
}
Also see: Tab Triggers