I am trying to create a vertical timeline with some icons in it.
I used this as my starting point. I somehow managed to do it with extra span inside the div.
However it looks kind a messy. Because I use white background to hide the line, and use extra span to add the images.
Could you review my code and help me to add different images based on id or class of the li
Thanks.
Overall, I want to achieve
1. Add image based on class or id of li
2. Remove any unnecessary span img tags to clean the code.
My Version
Snippet :
body{
line-height:1.3em;
}
.history-tl-container{
font-family: "Roboto",sans-serif;
width:50%;
margin:auto;
display:block;
position:relative;
}
.history-tl-container ul.tl{
margin:20px 0;
padding:0;
display:inline-block;
}
span.check {
width: 24px;
height: 24px;
background-repeat: no-repeat;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAnFJREFUSA3tU01oE0EUnpndVBKjNGkKelLpxYOg4MlSEW9RqCVZEMEfFFEP/mDQ2lSK4Ck/RCh40YseBEHtbmovXuoPeO3Jiz/0okKFStJqBUmyO883WyZMdjdtSb3pHObN+74335uZ94aQ/2OVF6Cr8Gumq8ND+6mmZVAw7AB/2FOYfCo2/5UElWwqqRE2hWoheSIgcCqWsx4xCXRqF68P7kDxx6q4qwU0I+y6EnzN7AtDqMtC8ZjvgBQS604Q3bD1Pr7xHp+4AIC8FkYXUyejmjUuUUpOBu4FqPC6Mya4jopcGRnq16j+xvfuQhGIg3OyO29OC7d5g+83jmzSmW4AwEanRq3eceubCPCO+eHDWxjTJhBvdowaw4GMxQvL4gJ3bzB3bTAR6Qq9RXenAIGQX4TzE7FC+bnw5Zg5vzfUF9/2ilI6IDHV4j4rljMNFXO7KBLSr0pxQWLWKKXMrI6kL6jBffHtpXbieKwPttM4rcaLtZsACNvtJTCLxhi9tzCaui24ajZ1HIt6xReHAD7rku1Aurc4teTll2sA/BOhwV+CEnZrcdTYhT8z6d0sfUromUTRei991bqqdo2W8BjzKuFZp1Ek4sFclxMoYseYQZzA3ASiY+wGPYCn/NwuMAjHor6cnrVuBnESa75L4o6JRbL7cdM7Sa5kAciX3/X6saPP3L5vG+q2qcpWLh/azKLhSXySgyresgaoNbg9gEWdacEDnOYNJNdz98XPudmPSazJE4n5LCcX1yIu9vluoIhRbNEJ7KK0gmFP8gfd+fLZFmwFx3cDJRZiubKBX7+AX3sBe/0H57w0ni+fU2L+geUfUZTBZo5OpcoAAAAASUVORK5CYII=);
background-repeat: no-repeat;
left: -14px;
position: absolute;
padding: 20px;
}
.history-tl-container ul.tl li{
list-style: none;
margin:auto;
margin-left:200px;
min-height:50px;
border-left:1px solid #86D6FF;
padding:0 0 50px 30px;
position:relative;
}
.history-tl-container ul.tl li:first-child:before{
background: rgba(138, 223, 199, 1) none repeat scroll 0 0;
}
.history-tl-container ul.tl li:last-child{ border-left:0;}
.history-tl-container ul.tl li::before{
background: #FFFFFF none repeat scroll 0 0;
border: 2px solid rgba(138, 223, 199, 0.74);
border-radius: 500%;
content: " ";
height: 30px;
left: -18px;
position: absolute;
top: -5px;
transition: all 500ms ease-in-out 0s;
width: 30px;
}
/* .history-tl-container ul.tl li:hover::before{
border-color: #258CC7;
transition: all 1000ms ease-in-out;
} */
ul.tl li .item-title{
}
ul.tl li .item-detail{
color:rgba(0,0,0,0.5);
font-size:12px;
}
ul.tl li .timestamp{
color: #8D8D8D;
position: absolute;
width:100px;
left: -50%;
text-align: right;
font-size: 12px;
}
<div class="history-tl-container">
<ul class="tl">
<li class="tl-item" ng-repeat="item in retailer_history">
<span class="check"></span>
<div class="timestamp">
3rd March 2015<br> 7:00 PM
</div>
<div class="item-title">Start from Shire</div>
<div class="item-detail">Don't forget the ring</div>
</li>
<li class="tl-item" ng-repeat="item in retailer_history">
<div class="timestamp">
19th March 2015<br> 3:00 PM
</div>
<div class="item-title">Kill some Orcs</div>
<div class="item-detail">Don't enter the caves!!</div>
</li>
<li class="tl-item" ng-repeat="item in retailer_history">
<div class="timestamp">
1st June 2015<br> 7:00 PM
</div>
<div class="item-title">Throw that goddamn ring in the lava</div>
<div class="item-detail">Also, throw that Gollum too</div>
</li>
</ul>
</div>
You could use the ::after property.
.history-tl-container ul.tl li.achieved::after {
content: "";
width: 24px;
height: 24px;
position: absolute;
top: 0;
left: -14px;
background-repeat: no-repeat;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAnFJREFUSA3tU01oE0EUnpndVBKjNGkKelLpxYOg4MlSEW9RqCVZEMEfFFEP/mDQ2lSK4Ck/RCh40YseBEHtbmovXuoPeO3Jiz/0okKFStJqBUmyO883WyZMdjdtSb3pHObN+74335uZ94aQ/2OVF6Cr8Gumq8ND+6mmZVAw7AB/2FOYfCo2/5UElWwqqRE2hWoheSIgcCqWsx4xCXRqF68P7kDxx6q4qwU0I+y6EnzN7AtDqMtC8ZjvgBQS604Q3bD1Pr7xHp+4AIC8FkYXUyejmjUuUUpOBu4FqPC6Mya4jopcGRnq16j+xvfuQhGIg3OyO29OC7d5g+83jmzSmW4AwEanRq3eceubCPCO+eHDWxjTJhBvdowaw4GMxQvL4gJ3bzB3bTAR6Qq9RXenAIGQX4TzE7FC+bnw5Zg5vzfUF9/2ilI6IDHV4j4rljMNFXO7KBLSr0pxQWLWKKXMrI6kL6jBffHtpXbieKwPttM4rcaLtZsACNvtJTCLxhi9tzCaui24ajZ1HIt6xReHAD7rku1Aurc4teTll2sA/BOhwV+CEnZrcdTYhT8z6d0sfUromUTRei991bqqdo2W8BjzKuFZp1Ek4sFclxMoYseYQZzA3ASiY+wGPYCn/NwuMAjHor6cnrVuBnESa75L4o6JRbL7cdM7Sa5kAciX3/X6saPP3L5vG+q2qcpWLh/azKLhSXySgyresgaoNbg9gEWdacEDnOYNJNdz98XPudmPSazJE4n5LCcX1yIu9vluoIhRbNEJ7KK0gmFP8gfd+fLZFmwFx3cDJRZiubKBX7+AX3sBe/0H57w0ni+fU2L+geUfUZTBZo5OpcoAAAAASUVORK5CYII=);
background-repeat: no-repeat;
left: -14px;
}
Note, you must add "achieved" class to the li where the check should be displayed. Also, you might use this class for highlighting the green color.
.history-tl-container ul.tl li.achieved::before{
background: rgba(138, 223, 199, 1) none repeat scroll 0 0;
}
The span is alright, though, but if you use my solution, you should get rid of it.
Related
I want to make a utility box on the left side of my page, with two buttons: A blue one and a grey one. The grey one has a tooltip within it.
Here is the code:
body {background:black}
#side-root {
position:fixed;
bottom:0;
z-index:9999;
display:flex;
width:100%;
top: 50%;
flex-direction: column;
width: 65px !important;
bottom:auto !important;
transform:translate(0,-50%);
left:0;
padding-right:40px;
}
#side-root a:hover, #side-root b:hover{
padding-left:9px;
}
#side-root a div, #side-root b div{
height:45px;
width:45px;
background-repeat:no-repeat;
margin:0 auto;
background-size:45px
}
.side-a {
background:#1877F2d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
}
.side-a:hover {
background:#1877F2;
backdrop-filter:none;
}
.side-b {
background:#B1B1B1d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
}
.side-b:hover {
background:#B1B1B1;
backdrop-filter:none;
}
.b-tooltip {
position: fixed;
white-space: nowrap;
width: auto !important;
height: auto !important;
padding: 0.5rem;
font-size: 0.875rem;
box-shadow: 0 1px 1px rgba(173, 168, 168, 0.1);
border-radius: 3px;
background-color: #333;
color: #fff;
border: 1px solid #333;
line-height: 18px;
box-sizing: border-box;
transition: opacity .2s ease-in-out;
z-index:9;
top:4px;
left:76px;
}
.b-tooltip svg {
position: static;
fill: #fff;
margin-right: 0.5rem;
width: 14px;
height: 14px;
vertical-align: middle;
}
<div id="side-root">
<a class="side-a">
<div class="side-a-icon"></div>
</a>
<b class="side-b">
<div class="side-b-icon">
<div class="b-tooltip">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M19 0C8.5 0 0 8.5 0 19s8.5 19 19 19 19-8.5 19-19S29.5 0 19 0zm0 24.8c-1.6 1.6-4.2 1.6-5.8 0l-5.4-5.4 2.9-2.9 5.4 5.4 11-11 2.9 2.9-11 11z"></path></svg>
<span>done</span>
</div>
</div>
</b>
</div>
The expected behavior is to keep the .b-tooltip box always fixed. However, it's very strange that if I hover the mouse on the .side-b, the .b-tooltip box would go up.
What's even weird is that this happens only on Chrome Version 96.0.4664.55 (Official Build) (x86_64) :
And even worse, is that on Safari Version 15.1 (17612.2.9.1.20), it's still not right (the problem is that .b-tooltip is always on the first blue box, which should be on the second grey box)
What I want is:
Don't shift the .b-tooltip box when I hover
Make the .b-tooltip box's position related to the second grey box, not the first blue box.
Is this that you are looking for?
body {background:black}
#side-root {
position:fixed;
bottom:0;
z-index:9999;
display:flex;
width:100%;
top: 50%;
flex-direction: column;
width: 65px !important;
bottom:auto !important;
transform:translate(0,-50%);
left:0;
padding-right:40px;
}
#side-root a:hover, #side-root b:hover{
padding-left:9px;
}
#side-root a div, #side-root b div{
height:45px;
width:45px;
background-repeat:no-repeat;
margin:0 auto;
background-size:45px
}
.side-a {
background:#1877F2d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
position: relative;
}
.side-a:hover {
background:#1877F2;
backdrop-filter:none;
}
.side-b {
background:#B1B1B1d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
position: relative;
}
.side-b:hover {
background:#B1B1B1;
backdrop-filter:none;
}
.b-tooltip {
position: absolute;
white-space: nowrap;
width: auto !important;
height: auto !important;
padding: 0.5rem;
font-size: 0.875rem;
box-shadow: 0 1px 1px rgba(173, 168, 168, 0.1);
border-radius: 3px;
background-color: #333;
color: #fff;
border: 1px solid #333;
line-height: 18px;
box-sizing: border-box;
transition: opacity .2s ease-in-out;
z-index:9;
top:4px;
left:76px;
}
.side-b:hover .b-tooltip {
left: 86px;
}
.b-tooltip svg {
position: static;
fill: #fff;
margin-right: 0.5rem;
width: 14px;
height: 14px;
vertical-align: middle;
}
<div id="side-root">
<a class="side-a">
<div class="side-a-icon"></div>
</a>
<b class="side-b">
<div class="side-b-icon">
<div class="b-tooltip">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M19 0C8.5 0 0 8.5 0 19s8.5 19 19 19 19-8.5 19-19S29.5 0 19 0zm0 24.8c-1.6 1.6-4.2 1.6-5.8 0l-5.4-5.4 2.9-2.9 5.4 5.4 11-11 2.9 2.9-11 11z"></path></svg>
<span>done</span>
</div>
</div>
</b>
</div>
I am a beginner working on a front end project with HTML and CSS where on my website I have a welcoming picture which I include below :
I try to adjust the brightness of the image for better contrast using filter:brightness() on my image
However when I apply filter:brightness(50%); the brightness of the image obviously decreases but I lose the display of my logo on the left and my navbar on the right. I do not understand why this is happening and I would appreciate your help. My code :
.html,.body{
background-size: cover;
}
body{
overflow-x: hidden;
margin:0;
background: rgba(0, 0, 0, 0.1);
font-family: Arial, Helvetica, sans-serif;
}
.welcome-container{
position: relative;
top:0px;
left: 0px;
width:100%;
height:550px;
margin:0px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.welcome-pic{
position: relative;
}
.welcome-pic h5{
position: absolute;
top:0%;
left:6%;
}
#fly{
font-size: 55px;
}
.welcome-pic img{
background: linear-gradient( rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5) ), url('file:///Volumes/Animus/Jon/Dropbox/website/hellcity.jpg');
}
#welcome-plane{
filter: brightness(50%);
}
#book{
position: relative;
background-color: white;
border: none;
color: black;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
top:50%;
left:30%;
cursor: pointer;
}
.square-container{
position: absolute;
top: 2px;
left: 2%;
}
.ds-square{
background-color: red;
height: 50px;
width:50px;
opacity:1;
}
.ds-square span{
position: relative;
top:30%;
left:27%;
color:white;
font-size:20px;
}
.welcome-pic img {
width:100%;
height:550px;
opacity: 1;
}
.inside-pic{
position:absolute;
top:30%;
left:50%;
font-size: 60px;
transform: translate(-50%, -50%);
}
.welcome-pic ul{
position: absolute;
top:2px;
right:0%;
margin:0;
padding:0;
overflow:hidden;
background-color: transparent;
}
.welcome-pic li{
float:left;
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size:20px;
}
.inside-pic h3{
font-size:18px;
}
<div class = "welcome-container">
<div class = "welcome-pic">
<h5>DS <br/> AIRLINES</h5>
<div class="square-container">
<div class="ds-square">
<span id = "DS">DS</span>
</div>
</div>
<ul>
<li><a class="active" href = "#home">Home</a></li>
<li>News</li>
<li>About</li>
<li>Contact</li>
</ul>
<img src = "IMAGES/welcome_pic.jpg" alt="#" id = "welcome-plane">
<div class = "inside-pic">
<span id = "fly">FLY WITH DS <br/> AIRLINES</span>
<h3>Flights from or towards Athens ! Fly secure and comfortable with us! </h3>
<button id = "book">Book flight</button>
</div>
</div>
</div>
Thank you in advance.
You can use below code in your css (made image as background of div)
.welcome-pic{
background-image: linear-gradient(rgba(0,0,0,0.4),rgba(0,0,0,0.4)), url("IMAGES/welcome_pic.jpg") no-repeat center;
background-size: cover;
}
Make sure you remove img tag from your html.
You can adjust rgba values (alpha values) to specify brightness level.
It looks like you have a z-index layering issue. Use this css:
.welcome-pic{
z-index:0;
}
.square-container {
z-index: 1;
}
.welcome-pic ul {
z-index: 1;
}
Here is the codepen: https://codepen.io/ladywebhawk/pen/NWNPNzN
Block Quote Example
I'm trying to make my blockquote look like the image attached. I have the top and bottom gradients down, but I'm stuck on the left and right borders and I'm not sure how to round the quotations more. Also, I was wondering how to make a line to the right that connects to the picture. Thanks for the help!
Here's what I have so far
/*-------Testimonial Section Styles---------*/
section#testimonial-section {
height: 300px;
margin-top: 100px;
width: 100%;
}
/*------Block Quote Sttyles-------*/
.testimonial-paragraph-wrapper {
width: 100%;
padding: 20px;
margin: 10px auto;
text-align: center;
}
.testimonial-border {
display: inline;
margin-left: 117px;
float: left;
}
blockquote {
width: 100%;
padding: 36px 50px;
position: relative;
background: transparent;
margin-bottom: 0px;
/* gradient shining border */
background-image: linear-gradient(to left, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%), linear-gradient(to left, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%);
background-size: 90% 5px;
background-position: 100% 0%, -510% 100%;
background-repeat: no-repeat;
border-left: 5px solid rgba(108, 178, 61, 1);
border-right: 5px solid rgba(108, 178, 61, 1);
}
cite {
font-style: normal;
text-align: right;
float: right;
padding-right: 100px;
padding-top: 20px;
}
blockquote::before,
article blockquote::after {
top: 0;
bottom: 0;
width: 25px;
content: '';
position: absolute;
background: #61a036;
-webkit-box-shadow: 0 2px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px rgba(0, 0, 0, 0.25);
}
blockquote::before {
right: 100%;
}
blockquote::after {
left: 100%;
}
blockquote p {
font-size: 20px;
line-height: 1.5em;
margin-bottom: 28px;
color: #61a036;
padding-left: 40px;
padding-right: 40px;
}
blockquote p::before {
top: 0;
left: -33px;
color: #61a036;
content: '“';
font-size: 10em;
position: absolute;
text-shadow: -3px 0 #000;
padding-top: 0px;
}
blockquote p::after {
right: 16px;
color: #61a036;
content: '”';
bottom: -32px;
font-size: 10em;
position: absolute;
text-shadow: 3px 0 #000;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<section id="testimonial-section">
<div class="container">
<div class="row">
<div class="col-md-8 text-center">
<div class="testimonial-wrapper">
<div id="testimonial-border" class="testimonial-paragraph-wrapper">
<blockquote>
<p class="blockquote-text">My son had to go to the doctor’s office and my insurance didn’t pay for some of it, and rent was due ... then I looked at the calendar...I was going to be getting a big payment from FusionCash in only 3 more days, straight to my PayPal®
account!</p>
<cite>- John Hughes of Grants Pass, OR</cite>
</blockquote>
</div>
</div>
</div>
<div class="col-md-4 pull-right">
<div class="testimonial-img-wrapper">
<img class=" testimonial-img" src="http://res.cloudinary.com/alexscloud1234/image/upload/c_scale,w_200/v1516656363/ryan-fields-328391_lxjslk.png">
</div>
</div>
</div>
</div>
</section>
The connecting line can easily be done with flexbox, just use a pseudo element on your container and adjust the position with order.
(I took the bootstrap out of the equation, to simplify things... adapt as needed)
/*-------Testimonial Section Styles---------*/
#testimonial-section{
margin:20px;
display:flex;
align-items:center;
position:relative;
}
#testimonial-section:before{
content:"";
height:4px;
flex:1 1 10%;
background:#61a036;
}
.testimonial-img{
flex:1 1 20%;
border:4px solid #61a036;
border-radius:50%; padding:10px;
display:inline-block;
height:100%;
}
#testimonial-section blockquote{
margin:0;
border:4px solid #61a036;
flex:1 1 70%;
position:relative;
color: #61a036;
font-size:1.5em;
font-family:sans-serif;
order:-1;
}
#testimonial-section blockquote:before, #testimonial-section blockquote:after{
text-align:center;
background:white;
position:absolute;
font-size:8rem;
width:4rem; height:5rem;
}
#testimonial-section blockquote:before{
content:"“";
top:-2rem;
left:-2rem;
}
#testimonial-section blockquote:after{
content:"”";
bottom:-2rem;
right:-2rem;
}
.blockquote-text{
padding:1em;
}
cite{
font-size:1rem;
position:relative;
top:0.5rem;
background:white;
float:right;
}
<section id="testimonial-section">
<blockquote>
<p class="blockquote-text">My son had to go to the doctor’s office and my insurance didn’t pay for some of it, and rent was due ... then I looked at the calendar...I was going to be getting a big payment from FusionCash in only 3 more days, straight to my PayPal® account!</p>
<cite>- John Hughes of Grants Pass, OR</cite>
</blockquote>
<img class="testimonial-img" src="http://res.cloudinary.com/alexscloud1234/image/upload/c_scale,w_200/v1516656363/ryan-fields-328391_lxjslk.png">
</section>
The rest should be just positioning.
The webpage is this: http://www.peliculadicto.tk/
Every time i resize my window, the text inside the color grey bar with position: fixed at the upper, moves to sides. It never stays centered. How can i prevent this?
HTML
<div class="headbar">
<h1 id="logo">
Películas buenas
</h1>
<div id="menu">
<ul>
<li>Inicio</li>
<li>Peliculas</li>
<li>Estrenos</li>
<li>Ranking</li><li>Proximamente</li>
<li>Más vistas</li>
</ul>
(search) <div id="uwpqsf_idsr"><form id="uwpqsffrom_641" method="get" action="url"><div class="uform_titlesr"></div><input type="hidden" name="unonce" value="4b52cced4e"><input type="hidden" name="uformid" value="641"><input type="hidden" name="s" value="uwpsfsearchtrg"><div class="uwpqsf_classsr"><input id="uwpqsf_id_keysr" type="text" name="skeyword" class="uwpqsftext" placeholder="Busca por título, actor, director, género..." value=""></div></form></div>
</div>
</div>
CSS
.uwpqsf_classsr {
margin-bottom: 1px;
clear: both;
position: absolute;
bottom: 2.5px;
left: 57px;
}
.headbar {
position:fixed;
top: 0px;
left: 0px;
height: 42px;
width: 100%;
background-color: #9B9595;
background-image: -moz-linear-gradient(#B6AAAA,#000000);
background-image: -webkit-gradient(linear,0% 0,0% 100%,from(#B6AAAA),to(#000000));
background-image: -webkit-linear-gradient(rgb(177, 185, 185),rgb(73, 68, 73));
background-image: -o-linear-gradient(#B6AAAA,#000000);
border-bottom: 1px solid #A29A9A;
z-index: 3000;
opacity: 0.65;
}
#menu {
position: absolute;
min-width: 700px;
left: 221px;
}
#menu>ul>li {
float:left;
position:relative;
height:27px;
left:370px;
}
It's the
#menu {
left: 221px;
}
that's doing it.
this is happened because of left:221px in a #menu. you can use a float:right for to fix a div at right side.
It is because the left is set to fixed px. When the Window resizes, the space looks larger but in fact the space stays the same and it's the window that becomes smaller. Try using percent.
Well, maybe i didn't explain myself.
However, i've already fixed, took a very large time to figure out. Time for me and anyone who wants to compare:
CSS
.headbar {
position:fixed;
width: 100%;
height: 42px;
margin: 0px auto;
background-color: #9B9595;
background-image: -moz-linear-gradient(#B6AAAA,#000000);
background-image: -webkit-gradient(linear,0% 0,0% 100%,from(#B6AAAA),to(#000000));
background-image: -webkit-linear-gradient(rgb(177, 185, 185),rgb(73, 68, 73));
background-image: -o-linear-gradient(#B6AAAA,#000000);
border-bottom: 1px solid #A29A9A;
z-index: 3000;
opacity: 0.65;
}
#menu {
margin: 0px 332px 0px auto;
width: 48%;
position: relative;
right: 178px;
}
#menu>ul>li {
float:left;
height:27px;
margin-top:13px;
}
.uwpqsf_classsr {
}
input#uwpqsf_id_keysr {
color: #FFFFFF;
width:277px;
height:30px;
padding-left: 32px;
background: rgba(56, 53, 53, 0.12) url(/lupa.png) no-repeat;
border: 1px solid rgba(0,0,0,0.2);
-webkit-border-radius: 3px; -moz-border-radius: 3px;
}
HTML
<div class="headbar">
<h1 id="logo">
Películas buenas
</h1>
<div id="menu">
<ul>
<li>Inicio</li>
<li>Peliculas</li>
<li>Estrenos</li>
<li>Ranking</li><li>Proximamente</li>
<li>Más vistas</li>
</ul>
</div>
<div id="uwpqsf_idsr"><form id="uwpqsffrom_641" method="get" action="http://www.peliculadicto.tk/"><div class="uform_titlesr"></div><input type="hidden" name="unonce" value="4b52cced4e"><input type="hidden" name="uformid" value="641"><input type="hidden" name="s" value="uwpsfsearchtrg"><div class="uwpqsf_classsr"><input id="uwpqsf_id_keysr" type="text" name="skeyword" class="uwpqsftext" placeholder="Busca por título, actor, director, género..." value=""></div></form></div>
</div>
If you could kindly hover your mouse over the MORE button in the menu here:
http://jsfiddle.net/H8FVE/3/
You will notice that the big wide picture underneath (#featured) is covering the drop down div. Why and how can I fix it?
Here is part of my HTML code:
<div id="second-menu" class="clearfix">
<ul id="secondary-menu" class="nav sf-js-enabled">
<li class="manimation">Animation</li>
</ul>
<ul id="mega">
<li class="dif mmore" style="background:none;">More...
<div>
<ticman>
<ul>
<li class="mgames">Games</li>
<li class="mliterature">Literature</li>
<li class="marts">Arts</li>
<li class="mcontact" style="background:none;">Contact</li>
</ul>
</ticman>
<h2>Classes</h2>
<p>TimesSchedualMap</p>
<p>NamesStudyDirections</p>
<p>HealthDanceBiology</p>
<h2>Teachers</h2>
<p>BillyMadeleineLaurenSteve</p>
<p>PaddingtonStefanMichaelMadeline</p>
<p>ShannonMaryRaffaelloLorence R</p>
<h2>Location</h2>
<p>CarlsbadOceansideEl Cajon</p>
<p>VistaLa CostaEncinitas</p>
<p>San DiegoLos AnglesCardiff</p>
</div>
</li>
</ul>
</div> <!-- end #second-menu -->
<div class="et_cycle" id="featured">
Previous
Next
<div id="slides" style="position: relative; background-image: none;">
<div class="slide" style="position: absolute; top: 0px; left: 0px; z-index: 3; opacity: 1; display: block;">
<img width="958px" height="340px" alt="10 moments in cinematic history changing faith" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/et_temp/ip-man-donnie-yen-756651_958x340.jpg"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Aug 9, 2012</p>
<h2 class="featured-title">Some random text here</h2>
<p>Well, I like this trailer a bit better than Chasing Mavericks’. Well for one, Gerry gets to keep his Scottish brogue, wahoo! Plus, I kind of like seeing him with kids. I mean the last time he played dad to a little boy was in the wonderful indie Dear Frankie, and he’s definitely a natural with them. Then there’s the supporting cast: Catherine Zeta-Jones, Jessica Biel, Uma Thurman, Dennis Quaid and...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=43">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
<div class="slide" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 2; opacity: 0;">
<img width="958px" height="340px" alt="More experimental testings" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/2012/07/vlcsnap-2012-05-13-22h37m19s79-300x129.png"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Jul 30, 2012</p>
<h2 class="featured-title">More experimental testings</h2>
<p>Lets see how this one turns out… Lets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one tur
Lets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=10">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
<div class="slide" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 1; opacity: 0;">
<img width="958px" height="340px" alt="Testing this theme with image" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/et_temp/251932_10151043115229294_310983318_n-39277_635x340.jpg"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Jul 30, 2012</p>
<h2 class="featured-title">Testing this theme with image</h2>
<p>And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=6">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
</div> <!-- end #slides -->
</div> <!-- end #featured -->
And here is part of my CSS:
ul#secondary-menu li { background: url(images/secondary-menu-bg.png) repeat-y top right; }
ul#secondary-menu a { font-size: 16px; color: #48423f; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 22px 16px; }
ul#secondary-menu a:hover { color: #ffffff; text-shadow: 1px 1px 0 #404747; }
#second-menu ul.nav li:hover a {color: #ffffff; text-shadow: 1px 1px 0 #404747; }
ul#secondary-menu > li.current_page_item > a { color: #919e9e !important; }
ul#secondary-menu li ul, #category_mobile_menu { width: 360px !important; padding: 7px 0 10px; background: #fff url(images/content-bg.png); top: 55px !important; -moz-box-shadow:3px 3px 7px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 3px 3px 7px 1px rgba(0, 0, 0, 0.1); box-shadow: 3px 3px 7px 1px rgba(0, 0, 0, 0.1); -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; border-top-left-radius: 0px;-moz-border-radius-topleft: 0px; border-top-right-radius: 0px; -webkit-border-top-left-radius: 0px; -moz-border-radius-topright: 0px; -webkit-border-top-right-radius: 0px; z-index: 9999px; display: none; }
ul#secondary-menu ul li, #category_mobile_menu li a { margin: 0 !important; padding: 8px 0 8px 30px !important; width: 150px; float: left; }
ul#secondary-menu ul li a, #category_mobile_menu a { padding: 0 !important; }
ul#secondary-menu li:hover ul ul, ul#secondary-menu li.sfHover ul ul { top: -8px !important; left: 180px !important; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
ul#secondary-menu ul li.even-item { background: none; }
.mfilm:hover{
background:#ea2e49 !important;
}
.mtv:hover{
background:#2589cf !important;
}
.mwebvideos:hover{
background:#5c58ac !important;
}
.manimation:hover{
background:#43cf61 !important;
}
.manime:hover{
background:#c142a5 !important;
}
.mmanga:hover{
background:#e77848 !important;
}
.mcomics:hover{
background:#e8eb05 !important;
}
.mwriters:hover{
background:#ff3c75 !important;
}
.mmore:hover{
background:#4b5571 !important;
}
.mliterature:hover{
background:#2c8f83 !important;
}
.mgames:hover{
background:#e34328 !important;
}
.marts:hover{
background:#cc226a !important;
}
.mcontact:hover{
background:#9395aa !important;
}
/* ---------- Mega Drop Down --------- */
ul#mega li { padding-right: 0px; background: url(images/secondary-menu-bg.png) repeat-y top right; }
#mega {
list-style:none;
font-weight:bold;
height:2em;
}
#mega li {
padding: 23px 0px;
background:#999;
border:0px solid #000;
float:left;
text-align:center;
position:relative;
}
#mega li:hover {
background:#eee;
border-bottom:0; /* border-bottom:0; and padding-bottom:1px; keeps <li> and <div> connected */
z-index:1; /* shadow above adjacent li */
}
#mega a { font-size: 16px; color: #48423f; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 22px 16px;}
ul#mega a:hover { color: #FFFFFF; text-shadow: 1px 1px 0 #404747; }
/* ----------- Hide/Show Div ---------- */
#mega div {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #FFFFFF;
border-color: -moz-use-text-color #48423F #48423F;
border-right: 1px solid #48423F;
border-style: none solid solid;
border-width: 0 1px 1px;
font-weight: normal;
left: -999em;
margin-top: 1px;
position: absolute;
text-align: left;
width: 496px;
}
/* --------- Within Div Styles --------- */
#mega li:hover div {
left: -1px;
top: auto;
}
#mega li.dif:hover div {
left: -407px;
top: 72px;
}
#mega li.mmore:hover > a {
color: #FFFFFF; text-shadow: 1px 1px 0 #404747; /* Ensures hover on MORE remains */
}
#mega div h2 {
background: none repeat scroll 0 0 #999999;
clear: both;
float: left;
font-size: 1em;
margin: 10px 0 5px;
padding: 0 10px;
position: relative;
width: 300px;
}
#mega div ticman {
clear: both;
float: left;
position: relative;
margin-left:1px;
margin-right:1px;
width: 495px;
height: 74px;
background-image: url(images/morebgwide.png);
background-size:495px 74px;
background-repeat:no-repeat;
}
#mega div p {
float: left;
padding-left: 10px;
position: relative;
width: 106px;
}
#mega div p a {
clear: left;
float: left;
line-height: 1.4;
text-decoration: underline;
width: 100%;
}
#mega div a:hover, #mega div a:focus, #mega div a:active {
text-decoration: none;
}
/*------------------------------------------------*/
/*--------------[FEATURED SLIDER]-----------------*/
/*------------------------------------------------*/
#featured { position: relative; padding-bottom: 20px; margin-left: -1px; margin-right: -1px; }
a#left-arrow, a#right-arrow { position: absolute; top: 136px; width: 32px; height: 68px; text-indent:-9999px; }
a#left-arrow { background:url(images/left-arrow.png) no-repeat; left: -32px; }
a#right-arrow { background:url(images/right-arrow.png) no-repeat; right: -32px; }
.featured-top-shadow { background:url(images/featured-top-shadow.png) repeat-x; position: absolute; top:0px; left: 0px; width: 958px; height: 7px; }
.featured-bottom-shadow { background:url(images/featured-bottom-shadow.png) repeat-x; position: absolute; bottom:0; left: 0; width: 958px; height: 8px; }
.featured-description { position: absolute; width: 333px; height: 196px; top: 40px; right:54px; background:url(images/featured-description.png); padding: 27px 32px 40px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; }
.featured-description p.meta-info { font-family: Georgia, serif; font-style: italic; font-size: 12px; color: #747474; }
.featured-description p.meta-info a { text-decoration: none; color: #fff; }
h2.featured-title { font-family: 'Kreon', Arial, sans-serif; font-weight: lighter;font-size: 30px; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); margin-top: -4px; }
h2.featured-title a { text-decoration: none; color: #ffffff; }
.featured-description p { color: #c9c8c8; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); line-height: 19px; }
a.readmore { display: block; background: url(images/readmore.png); height: 27px; padding: 0 17px; color: #dfca81; font-size: 12px; line-height: 27px; position: absolute; bottom: 0px; right: 0px; text-shadow: none; }
#featured a.readmore { -moz-border-radius-bottomright: 10px;-webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; }
#featured a.readmore:hover { color: #fff; }
Although, I would advice overlooking the fiddle for a visual presentation of the issue: http://jsfiddle.net/H8FVE/3/
I have been trying to wrap my head around this all day to a point where I almost set my hair on fire. Do you know how to solve this?
Use the z-index css attribute to visually layer objects like this in HTML regardless of your DOM tree. I would advise you to test your eventual implementation cross browser though, especially IE7. Damn you IE7 for the extra work you cause us all.
See http://jsfiddle.net/H8FVE/6/:
Just add
#second-menu{
z-index:4;position:relative;
}
That's because slide has z-index:3, so if you want to see second-menu, its z-index must be higher.
And you have to add position:relative too because z-index has no effect on elements with position:static.
Edit:
I have seen you have
#mega div{
left:-999em;
}
#mega li.dif:hover div {
left: -407px;
top: 72px;
}
I think it would be better like this:
#mega > li.dif > div{
display:none:
left: -407px;
top: 72px;
}
#mega > li.dif:hover > div {
display: block;
}
That's because if you set left:-999em; to #mega div, you suppose that it won't be shown because -999em is a lot. But if you want to hide it, isn't it better not to display it?
And I have added child selectors (>) because in the future maybe you will modify it and add more divs inside #mega > li.dif > div; and child selectors should be faster than descendant selectors.
Try this:
#mega li:hover {
background:#eee;
border-bottom:0; /* border-bottom:0; and padding-bottom:1px; keeps <li> and <div> connected */
z-index:10; /* shadow above adjacent li */
}
I changed the z-index to 10, instead of 1.
http://jsfiddle.net/H8FVE/5/
Give #second-menu a z-index of 3
Give "#mega div" a z-index of 2
Give #featured a z-index of 1