Reputation: 8469
I am trying to make the div #top
opacity: 50%
, so when you scroll, it will show a faded portion of the webpage below it. When I run this, however, it does not show opacity. It still shows solid.
CSS:
#top {
width: 100%;
height: 40px;
background: #96f226;
text-align: center;
font-size: 30px;
color: #252525;
position: relative;
position: fixed;
opacity: 50%;
}
HTML:
<div id='top'>Cuisine List</div>
Upvotes: 0
Views: 258
Reputation: 59303
opacity
takes a decimal between 0 and 1, like so:
opacity: 0.5;
Also,
position
s - you should remove the first onefor position: fixed
to work, you must specify at least one location, such as:
top: 0px;
which will anchor it to the top.
Upvotes: 2