1
2

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 3 years have passed since last update.

【備忘録:HTML/CSS】cssのストック集って持ってたほうがいいよね?

Posted at

使えるcssデザインストック

見出し下線を2配色

スクリーンショット 2020-06-02 10.08.15.png
index.html
<h2 class="m-heading2_pseudo-class">お知らせ(before、after)</h2>
<h2 class="m-heading2_borderimage">お知らせ(border-image)</h2>
style.scss
.m-heading2_pseudo-class{
  font-size: 24px;
  position: relative;
  max-width: 400px;
  padding-bottom: 10px;
  &:before{
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 5px;
    background: #e3bf00;
  }
  &:after{
    content: "";
    position: absolute;
    bottom: 0;
    left: 80px;
    width: calc(100% - 100px);
    height: 5px;
    background: #000;
  }
}
.m-heading2_borderimage{
  border-image: linear-gradient(.25turn,#e3bf00 80px,#111 80px) 1/0 0 5px 0;
  border-bottom: solid;
  max-width: 400px;
  padding-bottom: 10px;
}

見出し下線を中央で2配色

スクリーンショット 2020-06-02 10.11.18.png

index.html
<h2 class="m-heading2_linecenter">お知らせ</h2>
style.scss
.m-heading2_linecenter{
  text-align: center;
  padding-bottom: 10px;
  border-image: linear-gradient(
                90deg,
                #ddd 45%,#e3bf00 45%,
                #e3bf00 55%,#ddd 55%) 1/0 0 5px 0;
  border-bottom: solid;
}

参考元:
https://note.com/pulpstyle

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?