The title images on Zhihu Discovery columns are generally displayed as shown below. Obviously, it is achieved using gradients. The idea is very interesting, mainly to have two aspects of cognition: This picture can actually be divided into two parts. The right side controls the graphics and gradient, and the left side is a solid color background that has nothing to do with the gradient. Transparent is also a color, and can be set as a gradient I'll post my own code below for reference only. layout <body> <div class="bg-gradient"> <div class="pic"></div> </div> </body> CSS Styles <style> .bg-gradient { margin: 0 auto; background: rgb(244, 195, 77); position: relative; width: 600px; height: 350px; } .bg-gradient .pic{ background-image: linear-gradient(to right, rgb(244, 195, 77), transparent), url("bg.jpg"); background-position: center; background-blend-mode: normal; position: absolute; height: 100%; width: 250px; right: 0; } </style> The final effect is as follows The above is my code, thanks for watching. ps: If you want to write something in it and something goes wrong, I don’t think it’s a problem. Well, that’s your problem. Listen to me, you have to solve it on your own. (Explicit words) |
>>: The neglected special effects of META tags (page transition effects)
I think the carousel is a relatively important po...
introduction During the front-end project develop...
1. Use contrasting colours. The contrast here ref...
Table of contents 1. Create objects by literal va...
Project requirements require some preprocessing o...
Copy code The code is as follows: 1. Sina Weibo &...
Table of contents 1. What is an index? 2. Why do ...
This article shares with you how to implement dra...
question Nginx takes $remote_addr as the real IP ...
1. Source of the problem A friend @水米田 asked me a...
The default firewall of CentOS7 is not iptables, ...
Let me first introduce an interesting property - ...
What is content overflow? In fact, when there is ...
Table of contents 1. Download MySQL 2. Unzip the ...
Solution: Just set the link's target attribute...