Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Auto Save

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.

HTML

              
                <a href="#" class="rv-card" ontouchstart="">
  <div class="front-card"> <!--前面-->
    <div class="front-inner">
      丸型カードの注意点
    </div>
  </div>
  <div class="back-card"> <!--背面-->
    <div class="back-inner">
      丸くなった分横幅が狭くなるので、widthやfont-sizeの調整に気を付けなければなりません。
    </div>  
  </div>
</a>
              
            
!

CSS

              
                /***********************
 カード全体(親)
***********************/
.rv-card{
  position: relative; /*子要素の基点*/
  display: block;
  width: 300px; /*幅*/
  height: 300px; /*高さ*/
  border-radius: 50%; /*円形にする*/
  transform-style: preserve-3d; /*3D化*/
  transition: 1.2s ease-in-out;
  box-shadow: 0 14px 16px -10px rgba(0,0,0,25%);
  color: inherit; /*リンク色無効*/
  text-decoration: none; /*リンク下線なし*/
}

/*ホバー時*/
.rv-card:hover{
  transform: rotateY(180deg); /*裏表反転*/
}


/*************************
 カード
*************************/

/* 表裏共通 */
.front-card, .back-card{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
  backface-visibility: hidden; /*裏向きを非表示*/
  -webkit-backface-visibility: hidden;
}

/* 表のカード */
.front-card{
  background: #eee; /*背景*/
  background-image: url("https://give-shot.jp/tokyocss/wp-content/uploads/2022/04/road-1072823_1280.jpg"); /*背景画像*/
  background-size: cover; /*要素に合わせる*/
}
/*表のフィルター*/
.front-card:before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: black; /*フィルター色*/
  opacity: 0.2; /*フィルターの濃さ*/
}

/* 裏のカード */
.back-card{
  transform: rotateY(180deg); /*裏に配置*/
  background: #983010; /*背景*/
}


/****************************
カードの中身
****************************/

/*表裏共通*/
.front-inner, .back-inner{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%); /*中央*/
  width: 250px; /*幅*/
}

/*表*/
.front-inner{
  font-weight: bold; /*太字*/
  color: white;
}

/*裏*/
.back-inner{
  color: white; /*文字色*/
  font-size: 15px; /*文字サイズ*/
  text-shadow: 0px 0px 4px rgba(0,0,0,50%); /*文字の影*/
}




/*** サンプル装飾 ***/
.rv-card{
  margin: 0 auto;
}
body{
  zoom: 0.85;
}
              
            
!

JS

              
                
              
            
!
999px

Console