プレビューイメージ
<!-- HTMLファイル -->
<div class="wrap">
<h class="square_title01"><span>CSSで<br>タイトルの<br>あしらい</span></h>
</div>
body{
background:#f8f8f8;
}
.wrap {
text-align: center;
}
.square_title01 {
display: inline-block;
}
.square_title01 span {
font-size: 22px;
aspect-ratio: 1 / 1;
padding: 1em;
color: #444;
border: solid 0.08em #444;
line-height: 1.2;
border-radius: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
box-shadow: 0.3em 0.3em 0 0 #444;
}
CodePenで確認する
プレビューイメージ
<!-- HTMLファイル -->
<div class="wrap">
<h class="square_title02"><span>CSSで<br>タイトルの<br>あしらい</span></h>
</div>
body{
background:#f8f8f8;
}
.wrap {
text-align: center;
}
.square_title02 {
display: inline-block;
}
.square_title02 span {
font-size: 22px;
aspect-ratio: 1 / 1;
padding: 1em;
color: #444;
border: solid 0.08em #444;
line-height: 1.2;
border-radius: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
box-shadow: 0.3em 0.3em 0 0 #444;
background: #FFFC7F;
}
CodePenで確認する
プレビューイメージ
<!-- HTMLファイル -->
<div class="wrap">
<h class="square_title03"><span>CSSで<br>タイトルの<br>あしらい</span></h>
</div>
body{
background:#f8f8f8;
}
.wrap {
text-align: center;
}
.square_title03 {
display: inline-block;
}
.square_title03 span {
font-size: 22px;
aspect-ratio: 1 / 1;
padding: 1em;
color: #444;
border: solid 0.08em #444;
line-height: 1.2;
border-radius: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
box-shadow: 0.3em 0.3em 0 0 #444;
background: repeating-linear-gradient(
45deg,
#FFFC7F 0%,
#FFFC7F 18px,
#fff 18px,
#fff 20px
);
}
CodePenで確認する