プロが教えるわが家の防犯対策術!

https://www.human.or.jp/
こちらのサイトのTOPページの「recruit tips」の背景が、
中央がグレーで左右がホワイト、またセクションの真ん中もホワイトのように見えます。
このような特殊なグラデーションはどのようにやるのでしょうか?
プロパティだけでも教えていただけたらこちらで調べてみます。

A 回答 (1件)

そのサイトの該当部分でやっていることを再現すると、こういうことです。



<html lang="ja">
<head>
<style type="text/css">
.block-a {
height: 200px;
-webkit-box-shadow: 0px 38px 43px -3px rgba(200,200,200,0.1);
box-shadow: 0px 38px 43px -3px rgba(200,200,200,0.1);
position: relative;
}
.block-a:before, .block-a:after {
background-repeat: no-repeat;
background-position: center;
background-size: cover;
content:"";
background: -webkit-gradient(linear, left top, left top, from(rgba(255,255,255,0.1)), color-stop(70%, #fff));
background: -webkit-linear-gradient(left, rgba(255,255,255,0.1), #fff 70%);
background: linear-gradient(to right, rgba(255,255,255,0.1), #fff 70%);
display: inline-block;
position: absolute;
width: 50%;
height: 100px;
bottom: -100px;
right: 0;
}
.block-a:before {
background: -webkit-gradient(linear, right top, left top, from(rgba(255,255,255,0.1)), color-stop(70%, #fff));
background: -webkit-linear-gradient(right, rgba(255,255,255,0.1), #fff 70%);
background: linear-gradient(to left, rgba(255,255,255,0.1), #fff 70%);
left: 0;
}

.block-b {
height: 200px;
position: relative;
}
</style>
</head>
<body>
<div class="block-a">
INTERVIEW
</div>
<div class="block-b">
RECRUIT TIPS
</div>
</body>
</html>
    • good
    • 0
この回答へのお礼

ありがとうございます!!!とても助かりました。

お礼日時:2018/12/16 18:13

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!