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.
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>吹き出しレイアウト</title>
</head>
<body>
<h3>吹き出し風レイアウト</h3>
<div class="fkd">
<figure class="fkd-img-left"><img src="w04.png" alt="質問女性"></figure>
<div class="fkd-text-right">
<p class="fkd-text fkd-tx-p fkd-tx-big">
Q1. 吹き出し風レイアウトってどうやるんですか??
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-right"><img src="w03.png" alt="質問女性"></figure>
<div class="fkd-text-left">
<p class="fkd-text fkd-tx-big fkd-tx-g">
A. HTMLとCSSの設定だけでできますよ。
</p>
<p class="fkd-text">
ワードプレスでは有名なプラグイン「Speech Bubble」があります。<br />
最近はアップデートしていないようですね。
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-left"><img src="w04.png" alt="質問女性"></figure>
<div class="fkd-text-right">
<p class="fkd-text fkd-tx-p fkd-tx-big">
Q2. ビジュアルエディターに登録できますか??
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-right"><img src="w03.png" alt="質問女性"></figure>
<div class="fkd-text-left">
<p class="fkd-text fkd-tx-big fkd-tx-g">
A. 拡張プラグインを使えばOKですよ。
</p>
<p class="fkd-text">
拡張プラグイン「TinyMCE Templates」というのがあります。<br />
自分で作ったHTMLコードを登録しておけます。
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-left"><img src="w04.png" alt="質問女性"></figure>
<div class="fkd-text-right">
<p class="fkd-text fkd-tx-p fkd-tx-big">
Q3. 辞めたいって思うことありますか??
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-right"><img src="w03.png" alt="質問女性"></figure>
<div class="fkd-text-left">
<p class="fkd-text fkd-tx-big fkd-tx-g">
A. みんなきっとあると思います。<br />
でもやりがいもたくさんあります。
</p>
<p class="fkd-text">
どこの会社でも同じかと思いますが、過酷な任務を必要とする自衛官はやはり肉体的にも精神的にもきついかも…
しかし、それをやりがいと思えば辞めたいと思う気持ちも訓練が終われば忘れてますね。
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-left"><img src="w03.png" alt="dummy"></figure>
<div class="fkd-text-right">
<p class="fkd-text fkd-tx-p fkd-tx-big">
Q4. 勤務中は電話かメールなどの連絡波取れる??
</p>
</div>
</div>
<div class="fkd">
<figure class="fkd-img-right"><img src="man4.png" alt="自衛隊員"></figure>
<div class="fkd-text-left">
<p class="fkd-text fkd-tx-big fkd-tx-g">
A. どんな仕事でも同じく、休憩時間などでは取れます。
</p>
<p class="fkd-text">
どの職場でも同じですが休憩時間や電話・メールができる場所では連絡は取れます。また演習中などは直接連絡は取りにくいですが、緊急を要するときは残留してる当直自衛官に連絡すれば大丈夫です。
</p>
</div>
</div>
</body>
</html>
/*--------------------
吹き出しを作る
--------------------*/
/* 全体のスタイル */
.fkd {
margin-bottom: 40px;
}
/* 左画像 */
.fkd-img-left {
margin: 0;
float: left;
width: 80px;
height: 80px;
}
/* 右画像 */
.fkd-img-right {
margin: 0;
float: right;
width: 80px;
height: 80px;
}
.fkd figure img {
width: 100%;
height: 100%;
margin: 0;
}
/* 左からの吹き出しテキスト */
.fkd-text-right {
position: relative;
margin-left: 100px;
margin-right: 40px;
padding: 10px;
border: 2px solid #ffc4d1;
border-radius: 8px;
}
/* 右からの吹き出しテキスト */
.fkd-text-left {
position: relative;
margin-right: 100px;
margin-left: 50px;
margin-bottom: 120px;
padding: 10px;
padding-left: 20px;
border: 2px solid #94d9db;
border-radius: 8px;
}
p.fkd-text {
margin: 0 0 20px;
}
p.fkd-text:last-child {
margin-bottom: 0;
}
/* 左の三角形を作る */
.fkd-text-right:before {
position: absolute;
content: '';
border: 8px solid transparent;
border-right: 12px solid #ffc4d1;
top: 10px;
left: -20px;
}
.fkd-text-right:after {
position: absolute;
content: '';
border: 8px solid transparent;
border-right: 12px solid #fff;
top: 10px;
left: -16px;
}
/* 右の三角形を作る */
.fkd-text-left:before {
position: absolute;
content: '';
border: 8px solid transparent;
border-left: 13px solid #94d9db;
top: 15px;
right: -23px;
}
.fkd-text-left:after {
position: absolute;
content: '';
border: 8px solid transparent;
border-left: 13px solid #fff;
top: 15px;
right: -19px;
}
/* 回り込み解除 */
.fkd:after,.fkd:before {
clear: both;
content: "";
display: block;
}
.fkd-tx-big {
font-size: 1.3em;
}
.fkd-tx-g {color: #4c8f91;}
.fkd-tx-p {color: #e3637f;}
Also see: Tab Triggers