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)
In the process of team development, it is essenti...
1. Problem The docker container logs caused the h...
Question: Although the index has been created, wh...
Personally, I think the decompressed version is e...
1. Common MySQL configuration All the following c...
Preface Still referring to the project mentioned ...
The previous article introduced a detailed exampl...
The span tag is often used when making HTML web pa...
It is very convenient to configure virtual host v...
Table of contents render.js part create-context.j...
Linux version: CentOS 7 [root@azfdbdfsdf230lqdg1b...
Lambda Expressions Lambda expressions, also known...
1. Introduction ● Random writing will cause the h...
When configuring proxy_pass in nginx, if you matc...
1. Create the /usr/local/services/zookeeper folde...