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.
<section class="sample">
<h3>募集職種</h3>
<h4 class="accordion_title">企画営業</h4>
<div class="accordion_content">
<p>
仕事内容<br>
・実際にお客様先へ訪問し、課題をヒアリング<br>
・お客様の戦略に関わり、課題を抽出<br>
・分析データや市場データを元にベストマッチなプランを考え、提案<br>
・既存クライアントへのフォロー営業、マーケティング戦略の立案<br>
・アフターフォロー<br><br>
なお、営業方法等は先輩がやさしく教えます。<br>
仕事を通して、大きく成長していきたいと考えている方からのご応募をお待ちしております。<br>
また、起業を考えている方も大歓迎です。<br><br>
求めるスキル<br>
・早く成長したいという気持ちを持っている方<br>
・人間関係を大切にし、信頼を得るコミュニケーションができる方
</p>
</div>
<h4 class="accordion_title">WEBデザイナー</h4>
<div class="accordion_content">
<p>
仕事内容<br>
・tech engineers jobの機能追加<br>
・自社メディアのiPhone、Android対応<br>
・ポートフォリオをはじめとする広報資料作成<br>
・画像加工・バナー作成<br>
・Facebook / Twitter / Instagramコンテンツ・デザイン<br><br>
社内で蓄積されたノウハウを随時共有し、<br>
よりレベルの高いデザインを求められる環境があります。<br>
Web全般はもちろんの事、社内勉強会を通じ、<br>
ソーシャルメディアと連動させる企画力や<br>
マーケティングスキルを身につけることもできます。<br><br>
求めるスキル<br>
・人間関係を大切にし、信頼を得るコミュニケーションができる方<br>
・新しい技術、文化に触れながら面白いものを作成したい方<br>
・HTML5、jQuery、CSS3の使用/イラスト作成、編集できる方
</p>
</div>
<h4 class="accordion_title">システムエンジニア</h4>
<div class="accordion_content">
<p>
仕事内容<br>
・Java,PHPでの開発<br>
・システムの改善<br>
・素早いパフォーマンス・チューニング<br>
・新規システムの設計、開発<br><br>
技術を駆使し、コンピュータ・システムを設計していただきます。<br>
また、自動化の実現や素早いフィードバックをしていただきます。<br><br>
求めるスキル<br>
・早く成長したいという気持ちを持っている方<br>
・人間関係を大切にし、信頼を得るコミュニケーションが出来る方<br>
・自らタスクを見つけ、実行することが出来る方<br>
・事業に最適なシステムや仕組みを作り上げることが出来る方
</p>
</div>
<h4 class="accordion_title">広報/PR、人事、経理など</h4>
<div class="accordion_content">
<p>
仕事内容<br>
・決算業務<br>
・請求書発行業務<br>
・コスト管理業務<br>
・社内外の情報収集<br>
・社内広報<br><br>
担当の事業において一環して業務をこなしつつ、広い視野を持って業務に取り組んでいただきます。<br>
また、職種にとらわれず、皆で一体感を持って事業を成長させていくことが可能です。<br><br>
求めるスキル<br>
・早く成長したいという気持ちを持っている方<br>
・人間関係を大切にし、信頼を得るコミュニケーションが出来る方<br>
・自ら考え、行動できる方
</p>
</div>
</section>
/* サンプル用の調整 */
body {
overflow-y: scroll;
}
.sample {
width: 80%;
margin: 0 auto;
}
/* ここからアコーディオン用 */
.accordion_title {
display: flex;
position: relative;
}
.accordion_title::before {
content: '';
display: block;
width: 24px;
height: 3px;
background-color: #ff5081;
position: absolute;
right: 0;
transform: rotate(90deg);
transition: .5s;
}
.accordion_title::after {
content: '';
display: block;
width: 24px;
height: 3px;
background-color: #ff5081;
position: absolute;
right: 0;
transform: rotate(0deg);
}
.accordion_title.active::before {
transform: rotate(0deg);
}
.accordion_title:hover {
cursor: pointer;
}
.accordion_content {
display: block;
margin: 0;
height: 0;
overflow: hidden;
transition: .5s;
}
.accordion_content.show {
margin-bottom: 40px;
}
.accordion_content:last-of-type {
margin-bottom: 40px;
}
window.onload = init();
function init() {
const accordion_items = document.querySelectorAll(".accordion_title");
for (var i = 0; i < accordion_items.length; i++) {
accordion_items[i].addEventListener("click", function () {
this.nextElementSibling.classList.toggle("show");
this.classList.toggle("active");
if (this.classList.contains("active")) {
this.nextElementSibling.style.height =
// 40は余白分
this.nextElementSibling.children[0].clientHeight + 40 + "px";
} else {
this.nextElementSibling.style.height = 0;
}
});
}
}
Also see: Tab Triggers