2018/03/11
css
備忘録です。
CSSで台形を作る方法です。
参考サイト
[CSS] 台形をつくる(角を丸くしてみたり、中に文字を入れてみたり。)
The Shapes of CSS
HTML
<div class="trapezoid"></div>
CSS
.trapezoid {
width: 120px;
border-bottom: 80px solid orange;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
height: 0;
}
HTML
<div class="trapezoid">文字を入れます</div>
CSS
.trapezoid {
width: 160px;
border-bottom: 80px solid orange;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
height: 0;
text-align: center;
line-height: 80px;
}
HTML
<div class="trapezoid">
<div class="inner">文字です。<br>二行目ですよ。</div>
</div>
CSS
.trapezoid {
width: 160px;
border-bottom: 80px solid orange;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
height: 0;
text-align: center;
}
.inner {
padding-top: 14px;
}
HTML
<div class="trapezoid"></div>
CSS
.trapezoid {
width: 120px;
border-top: 80px solid orange;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
height: 0;
}
HTML
<div class="trapezoid"><span>文字</span></div>
CSS
.trapezoid {
position:relative;
width: 120px;
border-top: 80px solid orange;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
height: 0;
text-align: center;
}
.trapezoid span{
position:relative;
top:-60px;
}
ゼヒトモ内でのプロフィール: ROCKSTREAM, ゼヒトモのホームページ作成・制作サービス, 仕事をお願いしたい依頼者と様々な「プロ」をつなぐサービス
2025/01/31
JQuery
2025/01/01
神社
御朱印
相模原
2024/10/27
ブラウザ
カスタム投稿
Wordpress
2024/08/20
神社
御朱印
2024/07/06
神社
御朱印