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. 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.
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.
If the stylesheet 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 CSS 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.
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.
<main>
<header class="title accent uppercase"><h1><span>Госизда</span>т</h1></header>
<h2 class="subtitle accent uppercase">Государственное Издательство</h2>
<p class="price accent uppercase">Цена <span>50</span> коп.</p>
<p class="info uppercase">Открыта подписка на 1927 г. На журналы:</p>
<p class="location accent uppercase">Москва</p>
<section class="first">
<h2 class="uppercase">Новый Леф</h2>
<h3><span class="uppercase">Ежемесяч. Журнал.</span> 12 №№ в год. Под. редакц. <span class="uppercase">В.В. Маяковского.</span></h3>
<p>Подписная цена: на год—6р., на полгода—3р.30к., на 3м.—1р.75к. Цена отдельного номера—60к. Для годовых подписчиков допускается рассрочка при подписке—4р. И не позднее 1/VI—2 рубля.</p>
</section>
<section class="second">
<h2 class="uppercase">На Литературном Посту</h2>
<h3 class="uppercase">Двухнедельный журнал марксистской критики.</h3>
<h4>Под ред л. Авербаха, б. Волина, юр. Либединского, м. Ольминского, и ф. Раскольникова.</h4>
<p><span class="uppercase">Подписная цена</span>: на год—10р., на полгода—5р.50к., на 3 м.—3р. С приложениями в год—15 руб. Цена отдельного номера—50 коп. для годовых подописчегов допускается рассрочка: При подписке—6р. И не позднее 1/VI—4р. С приложениями при подписке—8р.50к. И не позднее 1/VI—6р.50к.</p>
<p><span class="uppercase">Приложения</span>: ф. Меринг.—легенда о лессинге. Цена 2 руб. Фриче.—социология искусства. Ц. 2р. Плеханов.—история русской общественной мысли, в 3 томах. Т. I·й—ц. 2р. Т. Ii·й—ц. 1р.50к. Т. Iii·й—ц. 1р.50к. Для год. Подп.—вместо 9р. Всего за 5р.</p>
</section>
<section class="third">
<h2 class="uppercase">Октябрь</h2>
<p>ежемесячный литературно-художественный и общественно-политический журнал.</p>
<h3 class="uppercase">Орган всесоюзной и массовой ассоциации пролетарских писателей.</h3>
<h4>Ответственный редактор A. С. Серафимович. Редколлегия: Н. Полетаев, A. Фадеев и Н. П. Полосихин.</h4>
<p>В 1927 году журнал выходит в реорганизованном виде. Вводятся новые отделы политический, в быту, в производстве, переписка с читателями и др.</p>
<p><span class="uppercase">Подписная цена</span>: на год—10р., на полгода—5р.50к., на 3 мес.—3р. Цена отдельного номера—1р.10к.</p>
</section>
<p class="brochure accent uppercase">Требуйте подробный иллюстрированный проспект. На все журналы госиздата с приложениями и на подписные издания—высылается бесплатно.</p>
<p class="subscriptions accent"><span class="uppercase">Подписка принимается</span>: отделом подписных и периодических изданий торгсектора госиздата: москва, воздвиженка, 10, тел. 4-87-19 и 5-83-91. Лениград, проспект 25 октября, 28, тел. 5-44-56, в книжных магазинах, киосках, провинциальных отделениях и филиалах госиздата, у уполномоченных, снабженных соответствующими удостоверениями, и по всех почтово-телеграфных конторах.</p>
<b class="border1"></b>
<b class="border2"></b>
<b class="border3"></b>
</main>
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@font-face {
font-family: 'Devaju';
src: url('https://raw.githack.com/huijing/filerepo/gh-pages/fonts/dejavusans-bold-webfont.woff2') format('woff2'),
url('https://raw.githack.com/huijing/filerepo/gh-pages/fonts/dejavusans-bold-webfont.woff') format('woff');
}
@font-face {
font-family: 'Mikodac';
src: url('https://raw.githack.com/huijing/filerepo/gh-pages/fonts/mikodacspcs-fmac.woff2') format('woff2'),
url('https://raw.githack.com/huijing/filerepo/gh-pages/fonts/mikodacspcs-fmac.woff') format('woff');
}
* {
margin: 0;
padding: 0;
}
body {
display: flex;
background-color: #333;
margin: 2em;
font-family: sans-serif;
}
main {
background-color: #dbdbdb;
color: #100f15;
padding: 2em;
margin: auto;
min-width: 1080px;
max-width: 1080px;
display: grid;
grid-template-columns: min-content 1em repeat(3, 14em 1em) 4em min-content;
grid-template-rows: repeat(2, min-content) 15em repeat(3, 2em min-content) repeat(2, min-content);
}
.title,
.location,
.subtitle {
font-family: 'Mikodac', sans-serif;
}
.price,
.info {
font-family: 'Devaju', sans-serif;
}
section h2,
section h3,
section h4 {
font-family: 'Oswald', sans-serif;
text-align: center;
}
section h2 {
font-size: 2.5em;
font-weight: 700;
}
section h3 {
margin-bottom: 0.5rem;
font-weight: 500;
font-size: 1em;
}
section h4 {
font-size: 0.85em;
margin-bottom: 0.5rem;
font-weight: 450;
}
section p {
text-align: justify;
font-size: 1.05em;
}
.price {
grid-row: 1;
grid-column: 1 / span 2;
display: flex;
justify-content: space-between;
align-items: baseline;
padding-left: 1.5rem;
font-size: 1.2em;
span {
font-size: 1.3em;
}
}
.info {
grid-row: 2;
grid-column: 2 / span 8;
font-size: 1.65em;
letter-spacing: 0.05em;
&::after {
content: '';
display: block;
height: 1rem;
width: 100%;
background-color: black;
}
}
.title {
writing-mode: vertical-rl;
grid-column: 1;
grid-row: 3 / span 7;
display: flex;
h1 {
font-size: 8.5em;
transform: rotate(180deg);
padding-top: 4.5rem;
padding-left: 1rem;
span {
letter-spacing: 0.75em;
}
}
}
.location {
grid-column: 9 / span 2;
grid-row: 3;
align-self: end;
font-size: 2.4em;
margin-bottom: 2rem;
letter-spacing: 0.1em;
}
.subtitle {
grid-column: 9 / span 2;
grid-row: 4 / -1;
writing-mode: vertical-rl;
font-size: 5.3em;
letter-spacing: 0.1em;
&::after {
content: '';
display: block;
width: 1em;
background-color: black;
}
}
.first {
grid-row: 5;
grid-column: 6 / span 2;
align-self: end;
}
.second {
grid-row: 7;
grid-column: 4 / span 4;
place-self: center;
p {
margin-bottom: 0.5rem;
}
}
.third {
grid-column: 2 / span 4;
grid-row: 9;
margin-bottom: 1rem;
h2 {
letter-spacing: 0.5em;
}
p {
text-align: center;
margin-bottom: 0.25rem;
}
}
.brochure {
padding-left: 1.5em;
grid-row: 10;
grid-column: 1 / span 7;
margin-bottom: 0.75rem;
font-weight: bold;
font-size: 1.2em;
&::before {
content: '';
display: block;
height: 4em;
width: 100%;
background-color: black;
margin-bottom: 0.5rem;
}
}
.subscriptions {
padding-left: 1.5em;
grid-row: 11;
grid-column: 1 / span 7;
text-align: justify;
font-weight: bold;
font-size: 1.1em;
}
.border1 {
grid-row: 3 / span 5;
grid-column: 2;
background-color: black;
margin: 1rem 0 2rem;
}
.border2 {
grid-row: 3 / span 3;
grid-column: 4;
background-color: black;
margin-top: 1rem;
}
.border3 {
grid-row: 3 / span 2;
grid-column: 6;
background-color: black;
margin-top: 1rem;
}
.accent {
color: #0e1e5b;
}
.uppercase {
text-transform: uppercase;
}
Also see: Tab Triggers