The drop-down box of the navigation menu is blocked and covered by the text box, and the display is not complete. How to put it on the top and display the background transparency?

insert image description here'insert image description here

Solution:
Add to the content that needs to be displayed on top:
position: relative;
z-index: 2;

Note:
One of the two lines of code must not be missing. Only writing the last one has no effect. I couldn’t figure it out before because I missed the above line.

If it doesn't work:
it may be because the z-index value of the blocked content is larger than the content value that needs to be displayed on top, so add the following text box: position: fixed;
z
-index: 1;

Background transparency:
After solving the display problem: there is another background that looks more transparent: add: opacity: 1
to the content that needs to be on top and the background is transparent

Knowledge points:
position: relative;
/ relative positioning: offset relative to its original position, the original position will be preserved /
z-index: 0; / level display 0 minimum height 999 /
opacity: 1; / background transparency 0 Between -1 /

Guess you like

Origin blog.csdn.net/weixin_47336389/article/details/122093296