Pen Settings

HTML

CSS

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. 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.

+ 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

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.

HTML

              
                ​<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="tanomu.css">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
	<meta charset="UTF-8">
	<title>tanomuyo</title>
</head>
<body>
  <section>
  <p class="h1-sub">正円の中に写真を入れ、PCとスマホで見栄えを変えるサンプルです。</p>
      <p class="sub_title">
        正円を複数作ります。そして、その中に写真を見やすく入れます。また文字もセンターに見やすく配置して入れます。<br>更にPCでは横に並べ、スマホでは縦に並べます。このページはそのサンプルです。
      </p>
<div class="sikaku-wrap">
<div class="square">
  <a href="#"><div class="circle-in" style="background-image: url(https://drive.google.com/uc?export=view&id=1mGO2jDCMTB2zicGBI9-IlAwp7vTpIAjH);no-repeat 50% 50%;background-size: cover;font-size:0.8vw;">
    	<span  class="moji1">W e b<br>マーケティング</span>
  </div></a>
</div>
<div class="square">
 <a href="#">  <div class="circle-in" style="background-image: url(https://drive.google.com/uc?export=view&id=1eCDamZgTe7iEfB7N9CpQ5MWlA5Tkxywr);no-repeat 50% 50%;background-size: cover;font-size:0.8vw;">
 	<span  class="moji">補助金サポート</span>
  </div></a>
</div>
<div class="square">
  <a href="#"> 	<div class="circle-in" style="background: url(https://drive.google.com/uc?export=view&id=1Ss5SqdnawVTCGVjhsSqL7ePQNeirP_Iw)no-repeat 100% 100%;background-size: cover;font-size:0.8vw;">
<span class="moji">WordPress</span>
  </div></a>
</div>
<div class="square">
  <a href="#"><div class="circle-in" style="background: url('https://drive.google.com/uc?export=view&id=1fzDsGYKq3BBI-rDapQHbO9qb2vVSbx6S')no-repeat 50% 50%;background-size: cover;font-size:0.8vw;">
<span  class="moji">consulting</span>
  </div></a>
</div>
  
</div> </section>
</body>
</html>


              
            
!

CSS

              
                
.h1-sub {text-align:center;font-size: 2em;line-height:2em;}

 /* 1 タイトル文字とサブタイトルです。 */
.sub_title{text-align:center;font-size: 1.4em;}

/* 正円を入れた正方形の箱を4つ入れる箱を作る。 */
.sikaku-wrap{
    display:flex;
}
/* 正円を入れる箱(おのずと正方形になる)を作る。 */
.square{position: relative;
  width:100%;margin: 10px;
  /* これを%指定などで可変にする。またはJavaScriptで値を変化させる。 */
}


/* 正円を作る。 */
.circle-in{
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 50%;
	vertical-align: middle;
}
/* 1個目の文字が見ずらいので渕線をこれだけ入れる。 */
.moji1{
    position: absolute;
    left: 0;
    top: 30%;
    margin: -.5em 0 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 4.3em;
   font-weight:bold;
  -webkit-text-stroke: 2px #7d7d7d;
}
/* 文字を中央に配置し、また枠に入る大きさにする。 */
.moji{
    position: absolute;
    left: 0;
    top: 50%;
    margin: -.5em 0 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 4em;
}
.circle-in:hover{
	position: relative;
	top:-5px;}

/* 960px以下は、ボックスは縦に並べる。正円は小さくならずに横幅いっぱいに広がり、文字は小さく、topに10PX開ける */
@media screen and (max-width: 960px) {.sikaku-wrap{
	    display:flex; flex-direction:column;}.square{margin:10px auto; width:100%;} .moji {font-size: 3em;}}
              
            
!

JS

              
                
              
            
!
999px

Console