お世話になっております。
添付ように画像の左上に三角マークをつけたいく、下記のソースコードのようにしたんですが、
三角の色を指定しないほうで可能でしょうか?
現在は赤になっておりますが、
実際は本当にトリミングされたように背景色に合わせたいです。
※ソースコード
<style> body { padding: 20px; background: green; } .hoge { height: 300px; width: 300px; overflow: hidden; position: relative; } .hoge::before { position: absolute; top: 0; left: 0; width: 30px; height: 30px; content: ""; border-top: 15px solid red; border-bottom: 15px solid transparent; border-left: 15px solid red; border-right: 15px solid transparent; } img { width: 100%; } </style> <body> <h2></h2> <div class="hoge"> <img src="//jp.taiwan.net.tw/resources/images/Attractions/0011773.jpg " /> </div> </body>
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/17 06:39
2017/08/17 09:49