Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource


Add Packages

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.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link href="" rel="stylesheet">


  <div class="bgRL">
    <a href="#">
      <span class="move mask">
        <img src="" alt="">
        <span class="cap">背景が右から出現+テキスト bgRL</span>



                @charset "utf-8";

/* 背景が上から出現+テキスト */
.bgRL {
  position: relative; /*テキストの基点となる位置を定義*/
  width: 80vw;
  margin: 0 auto; /*中央揃え*/

/* 背景が下から出現+テキスト */

.bgRL span.mask {
  position: relative; /*背景色の基点となる位置を定義*/
  display: block;
  line-height: 0; /*行の高さを0にする*/
  overflow: hidden; /*拡大してはみ出る要素を隠す*/

.bgRL span.mask::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  opacity: 0; /*透過0*/
  transition: 0.3s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
  transform: translateX(100%);
  background-image: linear-gradient(
    to right,
    #ff8177 0%,
    #ff867a 0%,
    #ff8c7f 21%,
    #f99185 52%,
    #cf556c 78%,
    #b12a5b 100%
  width: 100%;
  height: 100%;

.bgRL:hover span.mask::before {
  opacity: 0.5; /*透過なしに変化*/
  transform: translateX(0);

.bgRL span.cap {
  position: absolute;
  opacity: 0; /*透過0*/
  transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
  z-index: 3; /*テキストを前面に出す*/
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /*テキストの位置中央指定*/
  color: #fff; /*テキストの色を変えたい場合はここを修正*/
  line-height: 1.5; /*行の高さを1.5にする*/

.bgRL:hover span.cap {
  opacity: 1; /*透過なしに変化*/

/*========= レイアウトのためのCSS ===============*/

a {
  color: #333;
  text-decoration: none;

.lead {
  position: absolute;
  color: #fff;
  text-shadow: 2px 2px 5px #000;
  font-size: clamp(12px, 5vw, 2rem);
  text-align: center;
  font-weight: bold;

  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  white-space: nowrap;


img {
  width: 100%;
  height: auto;

/* 画像基本設定 */
.move {
  position: relative;
  margin: 50px auto; /*中央揃え*/
  box-shadow: 20px -10px #df859b;