Search code examples
htmlcsstextbackgroundoutline

HTML and CSS text background black


I don't know how to get rid of the black behind the navs. It seems to me all the css styling is not black when I review each element.

Here is a photo of my problem.

enter image description here

@charset "UTF-8";

/* CSS Document */

* {
  background-color: black;
}

body,
html {
  margin: 0;
  padding: 0;
}

video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 1;
}

.text {
  background: rgba(0, 0, 0, 0);
  z-index: 3;
  position: relative;
  color: white;
  font-family: Helvetica;
  text-align: left;
  padding-top: 50px;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 30px;
  letter-spacing: 8px;
  text-transform: capitalize;
  padding-left: 40px;
}

.contact {
  background: rgba(0, 0, 0, 0);
  z-index: 3;
  position: relative;
  color: white;
  font-family: Helvetica;
  text-align: right;
  padding-right: 20px;
  font-weight: 200;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 20px;
  letter-spacing: 3px;
  text-transform: capitalize;
}

#nav li {
  color: white;
  position: relative;
  font-size: 22px;
  font-weight: 200;
  z-index: 2;
  font-family: helvetica;
  padding-left: 20px;
  list-style: none;
  /*border: solid;*/
  letter-spacing: 4px;
  text-align: left;
  width: 250px;
  text-decoration: underline;
  line-height: 35px;
  background: none;
  /*border-radius: 100px;*/
}

#nav li a {
  text-decoration: none;
  color: white;
}

#nav li a:hover {
  color: #c1c1c1;
}

.contact a {
  text-decoration: none;
  color: white;
}

.contact a:hover {
  color: #c1c1c1;
}
<div class="banner">
  <video poster="pic.png" autoplay="true" loop="loop" muted>
	<source src="Melanie.mp4" type="video/mp4">
	<source src="Melanie.webm" type="video/webm">
	</video>
  <div class="text">MELANIE PULLEN</div>
  <div class="contact"><a href="#">Contact</a></div>
  <div id="nav">
    <ul>
      <li><a href="#">WORK  </a></li>
      <li><a href="#">INSTALLATIONS </a></li>
      <li><a href="#">CRIME SCENES  </a></li>
      <li><a href="#">BIOGRAPHY </a></li>
      <li><a href="#">PRESS</a></li>


    </ul>
  </div>
</div>


Solution

  • You have this :

    *{
        background-color:black;
    }
    

    This indicates that every element in the html document will have background-color:black , this includes the navs.

    Remove it and see the difference.