cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

              <div id="wrapper">
  <img id="img" src="">
  <div id="info">
    <p id="name"></p>
    <p id="email"></p>
    <p id="cell"></p>
  <button id="gain" class="button">Generator</button>
              #wrapper {
  margin: 0 auto;

img {
  float: left;
  display: block;
  margin: 0 auto;
  margin-bottom: 10px;
  border: 3px solid #fff;
  box-shadow: 1px 2px 4px #000;
  width: 200px;
  height: 200px;

#name {
  padding-top: 30px;
  font-size: 2.2em;
  font-weight: bold;

#email {
  padding-top: 17px;
  font-size: 1em;

#info {
  float: left;
  padding: 15px 5px;
  width: 250px;
  height: 177px;
  margin: auto;
  background: #c3609e;
  color: #fff;
  text-align: center;

p {
  margin: 0px;

$color: #e970e5;

@keyframes sheen {
  0% {
    transform: skewY(-45deg) translateX(0);
  100% {
    transform: skewY(-45deg) translateX(12.5em);

.button {
  cursor: pointer;
  width: 220px;
  border: none;
  margin-top: 80px;
  padding: 48px 0px;
  text-align: center;
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 24px;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  &:before {
    content: "";
    background-color: rgba(255,255,255,0.5);
    height: 100%;
    width: 3.5em;
    position: absolute;
    top: 0;
    left: -4.5em;
    transform: skewX(-45deg) translateX(0);
  &:hover {
    background: $color;
    color: #fff;
    border-bottom: 1px solid darken($color, 10%);
    &:before {
      transform: skewX(-45deg) translateX(13.5em);
     transition: all 0.6s ease-in-out;
  &:focus {
    outline: none;
              var gain = document.getElementById('gain');

// gainButton ClickでAPI読み込み
gain.addEventListener('click', function() {
  var script = document.createElement('script');
  script.src = "https://randomuser.me/api?callback=jsonData";

function jsonData(data) {

  var result = data.results[0];
  var name = document.getElementById('name');
  var email = document.getElementById('email');
  var img = document.getElementById('img');
  var cell = document.getElementById('cell');
  //html elementのあとをメソッドチェーンみたいにすることで、プロパティのバリューを指定できる。
  img.src = result.picture.large;
  name.textContent = result.name.first;
  email.textContent = result.email;
  cell.textContent = result.cell;
Loading ..................