0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

やく立つCSS集

Posted at

たまに使うCSSたちが覚えられねえ!メモしておこう。

モデル画面用のクラス

CSS
/*ベースクラス*/
.modal_overlay{
    display: flex;
    justify-content: center;
    overflow: auto;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    opacity: 1;
    transition: opacity 0.5s; /*おまけ*/
    transform: scale(1);      /*おまけ*/
}
/*コンテンツ用クラス*/
.modal_content{
    position: relative;
    align-self: baseline;
    width: 90%;               /*カスタム可*/
    top: 80px;                /*カスタム可*/
    padding: 30px 15px;       /*カスタム可*/
    box-sizing: border-box;   /*カスタム可*/
    background: #fff;         /*カスタム可*/
    line-height: 1.4em;       /*カスタム可*/
    transition: 0.5s;         /*おまけ*/
}
HTML使用例
<div class="modal_overlay">
  <div class="modal_content" id='modalTop'>
    <p>こんにちは!</p>
  </div>
<div>

:notes:

パンくず用クラス

CSS
# bcnav > ul > li > a[href]::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 15px;
  margin-left: 12px;
  -webkit-transform: rotate(45deg) skew(-15deg, -15deg) translate(-1px);
      -ms-transform: rotate(45deg) skew(-15deg, -15deg) translate(-1px);
          transform: rotate(45deg) skew(-15deg, -15deg) translate(-1px);
  border-top: solid 1px #333;
  border-right: solid 1px #333;
}
HTML使用例
<div id="bcnav">
  <ul>
    <li><a href="./xxx">大カテゴリ</a></li>
    <li><a href="./xxy">中カテゴリ</a></li>
    <li><a href="./xxz">小カテゴリ</a></li>
  </ul>
</div>

:notes:

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?