Разбираемся в CSS
Anonymous
Непрозрачность HTML CSS
Сообщение
Anonymous » 03 мар 2024, 16:54
I'm having a bit of a problem with my codes. I have a transparent/glassy looking navigation bar on my page. I am trying to add a logo over it, however when I do, the logo as well is transparent and can see through it.I tried way too many times to solve the problem, Hope you will help me.(There is my code)
*{ margin: 0; } ::-webkit-scrollbar { width: 0; } body{ background-color: rgb(11, 11, 11); } .main_bg { width: 100%; opacity: 0.6; width: 100%; position: fixed; } .nav-logo{ position: absolute; } nav button{ height: 20px; width: 120px; opacity: 1; background-color: #fff; border: #000000 1px; } nav { max-width: 1300px; margin: auto; padding: 2rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; } .nav-links { list-style: none; display: flex; align-items: center; gap: 3rem; flex-wrap: wrap; } .link a { position: relative; padding-bottom: 0.75rem; color: #fff; font-weight: bolder; } .link a::after { content: ""; position: absolute; height: 2px; width: 0; bottom: 0; left: 0; background-color: #23b5ce; transition: all 0.3s ease; } .link a:hover::after { width: 75%; cursor:pointer; } [*] JDM Japan
SHOP CARS OUR SERVICES FAQ MERCH INSTAGRAM Contact Us
Источник:
https://stackoverflow.com/questions/780 ... y-html-css
1709474052
Anonymous
I'm having a bit of a problem with my codes. I have a transparent/glassy looking navigation bar on my page. I am trying to add a logo over it, however when I do, the logo as well is transparent and can see through it.I tried way too many times to solve the problem, Hope you will help me.(There is my code) *{ margin: 0; } ::-webkit-scrollbar { width: 0; } body{ background-color: rgb(11, 11, 11); } .main_bg { width: 100%; opacity: 0.6; width: 100%; position: fixed; } .nav-logo{ position: absolute; } nav button{ height: 20px; width: 120px; opacity: 1; background-color: #fff; border: #000000 1px; } nav { max-width: 1300px; margin: auto; padding: 2rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; } .nav-links { list-style: none; display: flex; align-items: center; gap: 3rem; flex-wrap: wrap; } .link a { position: relative; padding-bottom: 0.75rem; color: #fff; font-weight: bolder; } .link a::after { content: ""; position: absolute; height: 2px; width: 0; bottom: 0; left: 0; background-color: #23b5ce; transition: all 0.3s ease; } .link a:hover::after { width: 75%; cursor:pointer; } [*] JDM Japan [img]img/main_image.jpeg[/img] [img]img/icon-nobg.png[/img] [list] SHOP CARS [*]OUR SERVICES [*]FAQ [*]MERCH [*]INSTAGRAM [/list] Contact Us Источник: [url]https://stackoverflow.com/questions/78096565/opacity-html-css[/url]