Achieving vertical structure from horizontally placed divs - html

I have a list of div elements that act as buttons. They have hover functionality from its CSS. I am placing them all in horizontal line. But I want them to be placed vertically that is one after another in the same line. I am not sure how I can do it since the width attribute places it in the same line.
How do I place them as new line function with certain equal distance?
body {
margin: 0;
font-family: 'Roboto Condensed', sans-serif;
}
h1 {
color: #333;
font-weight: 700;
margin-top: 125px;
text-align: center;
text-transform: uppercase;
letter-spacing: 4px;
line-height: 23px;
}
/* --- Start progress bar --- */
.process-wrapper {
margin: auto;
max-width: 1080px;
}
#progress-bar-container {
position: relative;
width: 90%;
margin: auto;
height: 100px;
margin-top: 65px;
}
#progress-bar-container ul {
padding: 0;
margin: 0;
padding-top: 15px;
z-index: 9999;
position: absolute;
width: 100%;
margin-top: -40px
}
#progress-bar-container li:before {
content: " ";
display: block;
margin: auto;
width: 30px;
height: 30px;
border-radius: 50%;
border: solid 2px #aaa;
transition: all ease 0.3s;
}
#progress-bar-container li.active:before,
#progress-bar-container li:hover:before {
border: solid 2px #fff;
background: linear-gradient(to right, #1a00aa 0%, rgb(0, 81, 255) 100%);
}
#progress-bar-container li {
list-style: none;
float: left;
width: 20%;
text-align: center;
color: #aaa;
text-transform: uppercase;
font-size: 11px;
cursor: pointer;
font-weight: 700;
transition: all ease 0.2s;
vertical-align: bottom;
height: 60px;
position: relative;
}
#progress-bar-container li .step-inner {
position: absolute;
width: 100%;
bottom: 0;
font-size: 14px;
}
#progress-bar-container li.active,
#progress-bar-container li:hover {
color: #444;
}
#progress-bar-container li:after {
content: " ";
display: block;
width: 6px;
height: 6px;
background: #777;
margin: auto;
border: solid 7px #fff;
border-radius: 50%;
margin-top: 40px;
box-shadow: 0 2px 13px -1px rgba(0, 0, 0, 0.3);
transition: all ease 0.2s;
}
#progress-bar-container li:hover:after {
background: #555;
}
#progress-bar-container li.active:after {
background: #207893;
}
<div class="process-wrapper">
<div id="progress-bar-container">
<ul>
<li class="step step01 active">
<div class="step-inner">A</div>
</li>
<li class="step step02">
<div class="step-inner">B</div>
</li>
<li class="step step03">
<div class="step-inner">C</div>
</li>
<li class="step step04">
<div class="step-inner">D</div>
</li>
<li class="step step05">
<div class="step-inner">E</div>
</li>
</ul>
</div>
</div>

Just add flex and flex-direction as column to the ul tag.
#progress-bar-container ul{
display:flex;
flex-direction:column;
padding: 0;
margin: 0;
padding-top: 15px;
z-index: 9999;
position: absolute;
width: 100%;
margin-top: -40px
}
For more information just look at this link
https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Related

How to align the menu to the right side of the desktop?

I am have a menu for my website and which is currently align on the left side of the browser. I am try to align on the right side of the browser.
here is the demo: here
what I want is just put the hole menu and align it on the right side of the browser screen. currently its showing on the left side.
trying to do:https://i.stack.imgur.com/D0y00.png
html code:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<header>
<span class="toggle-button">
<div class="menu-bar menu-bar-top"></div>
<div class="menu-bar menu-bar-middle"></div>
<div class="menu-bar menu-bar-bottom"></div>
</span>
<div class="menu-wrap">
<div class="menu-sidebar">
<ul class="menu">
<li>Home</li>
<li class="children">News
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li class="children">Contact
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li class="children">About
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li>FAQ</li>
<li>Services</li>
</ul>
</div>
</div>
</header>
<div class="wrapper" style="background-color:;padding:15px;">
<section class="text" style="background-color:;">
<h2 class="heading" id="headings" style="background-color:;text-align:center;">Three Line Menu & CSS Transitions</h2>
<p class="buttons" style="min-width: 200px;margin:auto;background-color:;text-align:center;">
Learn More
</p>
</section>
</div>
CSS:
html {
background: url(https://s33.postimg.cc/tm1vd9yy7/Background_2.jpg);
background-attachment:fixed;
background-repeat: no-repeat;
background-size: cover;
}
.btn_one {
text-decoration: none;
color: white;
font-weight: 100;
border: 1px #fbbc05 solid;
padding: 1em 3em;
border-radius: 100px;
}
a {
text-decoration: none;
}
ul {
padding-left: 0;
}
li {
list-style: none;
}
* {
box-sizing: border-box;
}
body {
font-family: 'Montserrat', Arial, serif;
}
::selection {
background-color: #EBEBF2;
color: #83828D;
}
/* ==================================== */
/* Navigaton Menu */
/* ==================================== */
.menu-wrap {
background-color: #625871;
position: fixed;
top: 0;
height: 100%;
width: 280px;
margin-left: -280px;
font-size: 1em;
font-weight: 700;
overflow: auto;
transition: .25s;
z-index: 10;
}
.menu-show {
margin-left: 0;
box-shadow: 4px 2px 15px 1px #262424;
}
.menu-sidebar {
margin: 75px 0 80px 10px;
position: relative;
top: 70px;
}
.menu-sidebar li {
padding: 18px 22px 0;
}
.menu-sidebar li > a {
color: #f3f3f3;
font-size: 1.18em;
position: relative;
}
.menu-sidebar li > a::after {
content: "";
display: block;
height: 0.15em;
position: absolute;
top: 100%;
width: 100%;
left: 50%;
transform: translate(-50%);
background-image: linear-gradient(to right, transparent 50.3%, #FFFA3B 50.3%);
transition: background-position .2s .1s ease-out;
background-size: 200% auto;
}
.menu-sidebar li > a:hover::after {
background-position: -100% 0;
}
.menu-sidebar .children {
position: relative;
}
.menu-sidebar .children .child-menu {
display: none;
}
.arrow::after {
content: "\f107";
font-family: 'FontAwesome';
padding: 10px;
color: #FFFA3B;
position: relative;
}
.arrow:hover::after {
cursor: pointer;
color: #fff;
}
.arrow:active::after {
top: 2px;
}
/*Hamburger Button*/
.toggle-button {
position: fixed;
width: 44px;
height: 40px;
top: 50px;
left: 40px;
padding: 4px;
transition: .25s;
z-index: 15;
}
.toggle-button:hover {
cursor: pointer;
}
.toggle-button .menu-bar {
position: absolute;
border-radius: 2px;
transition: .5s;
}
.toggle-button .menu-bar-top {
border: 4px solid #fff;
border-bottom: none;
top: 0;
width: 80%;
}
.toggle-button .menu-bar-middle {
height: 4px;
background-color: #fff;
margin-top: 7px;
margin-bottom: 7px;
width: 40%;
top: 4px;
}
.toggle-button .menu-bar-bottom {
border: 4px solid #fff;
border-top: none;
top: 22px;
width: 60%;
}
.toggle-button:hover div
{
width: 80%;
}
.button-open {
left: 25px;
}
.button-open .menu-bar-top {
border-color: #fff;
transform: rotate(45deg) translate(8px, 8px);
transition: .5s;
}
.button-open .menu-bar-middle {
background-color: #fff;
transform: translate(230px);
transition: .1s ease-in;
opacity: 0;
}
.button-open .menu-bar-bottom {
border-color: #fff;
transform: rotate(-45deg) translate(7px, -7px);
transition: .5s;
}
/* Text Block */
.wrapper {
width: 40%;
margin: 100px auto 0;
color: #83828D;
}
.wrapper .text {
padding: 30px;
}
.wrapper .text .heading {
margin-bottom: 40px;
font-size: 2em;
color:#fff;
}
.wrapper .text p {
line-height: 1.6em;
}
.wrapper .text .buttons {
margin-top: 40px;
}
/* Buttons */
.wrapper .buttons .button {
display: inline-block;
margin-right: 20px;
padding: 20px 25px;
border-radius: 2em;
background-color: #70CE64;
color: #fff;
font-size: .9em;
font-weight: 700;
transition: background-color .3s;
}
.wrapper .buttons .button-secondary {
background-color: #FF6746;
}
.wrapper .buttons .button-primary:hover {
background-color: #84D07A;
}
.wrapper .buttons .button-secondary:hover {
background-color: #FF7D60;
}
/*Active state for the buttons*/
.wrapper .buttons .button-primary:active {
background-color: #70CE64;
}
.wrapper .buttons .button-secondary:active {
background-color: #FF6746;
}
/*Icons*/
.wrapper .buttons .button span {
position: relative;
display: inline-block;
padding-right: 20px;
}
.wrapper .buttons .button span::after {
position: absolute;
font-family: "FontAwesome";
right: -3px;
font-size: 14px;
top: 0;
transition: top .3s, right .3s;
}
.wrapper .buttons .button-primary span::after {
content: "\f019";
}
.wrapper .buttons .button-secondary span::after {
content: "\f178";
}
/*Slight icons animation*/
.wrapper .buttons .button-primary:hover span::after {
top: 4px;
}
.wrapper .buttons .button-secondary:hover span::after {
right: -6px;
}
#media screen and (max-width: 480px) {
#headings{
margin-bottom:20px;
font-size: 18px;
color:#fff;
}
.btn_one {
text-decoration: none;
color: #fff;
font-size:12px;
font-weight: 100;
border: 1px #fbbc05 solid;
padding: 8px 23px;
border-radius: 100px;
}
ul {
padding-left: 35px;
}
.menu-sidebar li
{
padding:0;
}
.menu-wrap {
width: 200px;
}
}
SCRIPT:
$(document).ready(function() {
var $toggleButton = $('.toggle-button'),
$menuWrap = $('.menu-wrap'),
$sidebarArrow = $('.arrow');
// Hamburger button
$toggleButton.on('click', function() {
$(this).toggleClass('button-open');
$menuWrap.toggleClass('menu-show');
});
// Sidebar navigation arrows
$sidebarArrow.click(function() {
$(this).next().slideToggle(300);
});
});
Here is the source code for reference: https://nofile.io/f/9bKHsuOoUza/source_code_new.zip
Can anybody guide me? Any input is appreciated.
Thank you so much.
change the toggle button to:
default:
.toggle-button {
position: fixed;
width: 44px;
height: 40px;
top: 50px;
left: auto;
padding: 4px;
transition: .25s;
z-index: 15;
right: 40px;
}
open:
.button-open {
left: auto;
right: 25px;
}
then change the menu to:
closed:
.menu-wrap {
background-color: #00000030;
position: fixed;
top: 0;
height: 100%;
width: 240px;
margin-left: 0;
right: -280px;
font-size: 1em;
font-weight: 700;
overflow: auto;
transition: .25s;
z-index: 10;
left: auto;
}
open:
.menu-show {
left: auto;
right: 0;
margin-left: 0;
box-shadow: 4px 2px 15px 1px #080707;
}
easy as that!

HTML/CSS hover background image

I have a problem with putting an img for hover background.
It should look like this : Navigation
These 2 lines, represent the hover transparent image, and the text "home" should be in center of that img.. I have no idea how to do that... Anyone ?
Sorry if my english is bad
.page-container {
width: 980px;
margin: 0 auto;
text-align: center;
}
header {
margin: 0;
padding: 0;
width: 100%;
height: 220px;
background-color: #EAEAEA;
}
.logo {
text-align: center;
}
.logo img {
margin: 30px 0 0 0;
}
nav {
height: 136px;
}
ul {
list-style-type: none;
display: inline-block;
margin: 70px 0 0 0;
padding: 0;
}
nav li {
float: left;
text-align: center;
}
nav li a {
margin-right: 165px;
text-decoration: none;
float:left;
font-size: 22px;
letter-spacing: 3px;
text-transform: uppercase;
font-family: font91477;
color: #9E9E9E;
background-size: 75px;
}
a:focus {
text-decoration: none;
color: #9E9E9E;
}
a:hover {
height: 75px;
text-decoration: none;
color: #9E9E9E;
background: url(http://i.imgur.com/P5tF09r.png) no-repeat center;
}
<header>
<div class="logo">
<img src="img/logo.png"/>
</div>
<nav>
<div class="page-container">
<ul>
<li>Home</li>
<li>O Podjetju</li>
<li>Produkti</li>
<li><a class="last-child" href="#">Kontakti</a></li>
</ul>
</div>
</nav>
</header>
just add the following css styles
a:hover {
height: 75px;
text-decoration: none;
color: #9E9E9E;
background: url(http://i.imgur.com/P5tF09r.png) no-repeat center;
/*****************here they are ************/
display:flex;
align-items: center;
}
Why you don't make it in css ? Something like this
.menu{
list-style: none;
background-color: #EAEAEA;
margin: 0;
padding: 20px 0;
overflow: hidden;
}
.menu__item{
float: left;
margin: 0 20px;
position: relative;
}
.menu__item a{
background-color: #EAEAEA;
text-transform: uppercase;
position: relative;
z-index: 1;
}
.menu__item::after{
content:'';
width: 1px;
height: 1px;
background-color: #000;
position: absolute;
top: 50%;
left: 50%;
margin: 0;
transform: rotate(-45deg);
z-index: 0;
transition: all .25s ease;
}
.menu__item:hover::after{
width: 50px;
margin: -1px 0 0 -25px;
}
<ul class="menu">
<li class="menu__item"><a>Home</a></li>
<li class="menu__item"><a>test</a></li>
<li class="menu__item"><a>very long title for test</a></li>
<li class="menu__item"><a>test</a></li>
</ul>

CSS hold parent horizontal menu background

I am designing simple horizontal menu with html/css, see jsfiddle.net. The problem is that after hovering on li childrens i can not hold parent li background. See print screens below:
in this state, after hover on menu childrens, such as Settings or Applications, i can't hold background of parent block, such as Options :
You had added :hover effect for a tag and when you leave the a tag :hover is lost you can just add :hover to li tag and the :hover by using this you will not loose the :hover effect of the parent
.nav {
background: #C2E2EC;
height: 50px;
display: inline-block;
width: 100%;
margin: 0 0 10px 0;
padding: 0;
}
.nav li {
float: right;
list-style-type: none;
position: relative;
}
.nav li a {
font-size: 11px;
color: #000;
display: block;
line-height: 50px;
padding: 0 26px;
text-decoration: none;
font-family: Tahoma;
text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}
/* changed :hover to li:hover */
.nav li:hover {
background-color: #2e2e2e;
}
#settings img {
margin: 0;
padding: 0;
}
#settings a {
height: 50px;
font-size: 11px;
}
#settings img {
width: 48px;
margin: 0px;
padding: 0px;
font-size: 11px;
}
#search {
width: 338px;
margin: 4px;
}
#search_text {
width: 297px;
padding: 12px;
font-size: 11px;
font-family: tahoma;
border: 0 none;
height: 34px;
direction: rtl;
text-align: right;
margin-right: 0;
color: white;
outline: none;
background: #1f7f5c;
float: right;
box-sizing: border-box;
transition: all 0.15s;
}
#search_text:focus {
background: rgb(64, 151, 119);
}
#search_button {
border: 0 none;
cursor: pointer;
float: left;
height: 34px;
margin-left: 5px;
margin-top: 5px;
padding: 0;
text-align: center;
width: 34px;
}
#options a {
border-left: 0 none;
}
#options > a {
background-position: 85% center;
background-repeat: no-repeat;
padding-right: 42px;
color: #fff;
}
.subnav {
visibility: hidden;
position: absolute;
top: 110%;
right: 0;
width: 200px;
height: auto;
opacity: 0;
transition: all 0.1s;
background: #232323;
margin: 0;
padding: 0;
}
.subnav li {
float: none;
}
.subnav li a {
border-bottom: 1px solid #2e2e2e;
color: #fff;
}
#options:hover .subnav {
visibility: visible;
top: 100%;
opacity: 1;
}
<ul class="nav">
<li id="options">Options
<ul class="subnav">
<li>Settings
</li>
<li>Application
</li>
<li>Board
</li>
<li>Options
</li>
</ul>
</li>
</ul>

Horizontal timeline in pure css

I'm trying to make a timeline in pure CSS however I seem to be running into some problems.
When I try to set the timeline div as overflow-x: scroll it still scrolls on the y access.
This is what I've got:
#timeline {
height: 500px;
width: auto;
margin: 0;
background: red;
}
.event {
height: 500px;
}
.founded {
width: 400px;
float: left;
background: blue;
}
.grant {
width: 800px;
background: yellow;
}
<ol id="timeline">
<li class="event founded"></li>
<li class="event grant"></li>
</ol>
I just want each additional entry to follow the previous one and for it all be scroll-able horizontally. If anyone could point me in the right direction that would be amazing.
Thanks.
I literally JUST had to make one of these. This is what I came up with:
body {
padding: 25px;
font-family: sans-serif;
}
.timeline {
white-space: nowrap;
overflow-x: scroll;
padding: 30px 0 10px 0;
position: relative;
}
.entry {
display: inline-block;
vertical-align: top;
background: #13519C;
color: #fff;
padding: 10px;
font-size: 12px;
text-align: center;
position: relative;
border-top: 4px solid #06182E;
border-radius: 3px;
min-width: 200px;
max-width: 500px;
}
.entry img {
display: block;
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.entry:after {
content: '';
display: block;
background: #eee;
width: 7px;
height: 7px;
border-radius: 6px;
border: 3px solid #06182E;
position: absolute;
left: 50%;
top: -30px;
margin-left: -6px;
}
.entry:before {
content: '';
display: block;
background: #06182E;
width: 5px;
height: 20px;
position: absolute;
left: 50%;
top: -20px;
margin-left: -2px;
}
.entry h1 {
color: #fff;
font-size: 18px;
font-family: Georgia, serif;
font-weight: bold;
margin-bottom: 10px;
}
.entry h2 {
letter-spacing: .2em;
margin-bottom: 10px;
font-size: 14px;
}
.bar {
height: 4px;
background: #eee;
width: 100%;
position: relative;
top: 13px;
left: 0;
}
<div class="bar"></div>
<div class="timeline">
<div class="entry">
<h1>1990</h1>
<h2>Entry Title</h2>
<img src="http://dummyimage.com/300x200/000/fff" /> Here's the info about this date
</div>
<div class="entry">
<h1>1995</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2000</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2005</h1>
Here's the info about this date
</div>
<div class="entry">
<h1>2010</h1>
Here's the info about this date
</div>
</div>
You can refer the below link also
#import url(https://fonts.googleapis.com/css?family=Dosis:500);
body{
background: #F1F1F1;
}
.container{
width: 1200px;
margin: auto;
}
.timeline{
counter-reset: year 2016;
position: relative;
}
.timeline li{
list-style: none;
float: left;
width: 33.3333%;
position: relative;
text-align: center;
text-transform: uppercase;
font-family: 'Dosis', sans-serif;
}
ul:nth-child(1){
color: #4caf50;
}
.timeline li:before{
counter-increment: year;
content: counter(year);
width: 50px;
height: 50px;
border: 3px solid #4caf50;
border-radius: 50%;
display: block;
text-align: center;
line-height: 50px;
margin: 0 auto 10px auto;
background: #F1F1F1;
color: #000;
transition: all ease-in-out .3s;
cursor: pointer;
}
.timeline li:after{
content: "";
position: absolute;
width: 100%;
height: 1px;
background-color: grey;
top: 25px;
left: -50%;
z-index: -999;
transition: all ease-in-out .3s;
}
.timeline li:first-child:after{
content: none;
}
.timeline li.active{
color: #555555;
}
.timeline li.active:before{
background: #4caf50;
color: #F1F1F1;
}
.timeline li.active + li:after{
background: #4caf50;
}
<h1>DevelopersTips</h1>
<div class="container">
<ul class="timeline">
<li class="active">Bacon</li>
<li>Rib</li>
<li>Sausage</li>
</ul>
</div>

When hovering over a nav menu, everything underneath is pushed down but I need it to just stay over what's below it instead of pushing it down

I have made some div's with pictures so that when they get hovered over, a nav menu appears and expands the original div. However when the div expands, it pushes the other div's below it down. I want the nav menu & expanded div to just appear over the other div's below it (instead of pushing them down)
I've played around with the position as absolute/fixed but I can't get anything to work.
I made a JS fiddle with the code:
http://jsfiddle.net/cy3VF/
Thanks a lot in advance!
<div id="inbannergrid">
<div class="car">
<span class="blockspan"> Automotive</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspLauderdale BMW</li>
</ul>
</div>
<div class="realty">
<span class="blockspan">Realty</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspRealtor.com</li>
<li>&nbsp&nbsp&nbsp-&nbspApartments.com</li>
<li>&nbsp&nbsp&nbsp-&nbspRealDeal.com</li>
</ul>
</div>
<div class="weight">
<span class="blockspan">Weight-Loss</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspDoctorOZ.com</li>
<li>&nbsp&nbsp&nbsp-&nbspSimpleGreenSmoothies</li>
</ul>
</div>
<div class="furniture">
<span class="blockspan">Furniture</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspCoastalLiving.com</li>
</ul>
</div>
<div class="hotel">
<span class="blockspan"> Hotels</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspPriceLine.com</li>
</ul>
</div>
<div class="hospitals">
<span class="blockspan">Hospitals</span>
<ul class="blockmenu">
<li style="margin-top: 10px">&nbsp&nbsp&nbsp-&nbspUCompareHealthCare</li>
<li>&nbsp&nbsp&nbsp-&nbspRightDiagnosis.com</li>
</ul>
</div>
</div> <!-- END INBANNERGRID-->
AND CSS:
.car{
width: 200px;
height: 200px;
background: #777777 url("../view/images/car.png") top center no-repeat;
margin-right: 50px;
margin-bottom: 50px;
float: left;
display: block;
cursor: pointer;
border-radius: 15px;
border: 2px solid #777777;
}
.realty{
width: 200px;
height: 200px;
background: #777777 url("../view/images/realty.png") top center no-repeat;
margin-right: 50px;
margin-bottom: 50px;
float: left;
display: block;
cursor: pointer;
border-radius: 15px;
border: 2px solid #777777;
}
.weight{
width: 200px;
height: 200px;
background: #777777 url("../view/images/weightloss.png") top center no-repeat;
margin-bottom: 50px;
float: left;
display: block;
cursor: pointer;
border-radius: 15px;
border: 2px solid #777777;
}
.furniture{
width: 200px;
height: 200px;
background: #777777 url("../view/images/furniture.png") top center no-repeat;
margin-bottom: 50px;
margin-right: 50px;
float: left;
display: block;
cursor: pointer;
border-radius: 15px;
border: 2px solid #777777;
}
.hotel{
width: 200px;
height: 200px;
background: #777777 url("../view/images/hotel.png") top center no-repeat;
margin-bottom: 50px;
float: left;
display: block;
cursor: pointer;
margin-right: 50px;
border-radius: 15px;
border: 2px solid #777777;
}
.hospitals{
width: 200px;
height: 200px;
background: #777777 url("../view/images/hospitals.png") top center no-repeat;
margin-bottom: 50px;
float: left;
display: block;
cursor: pointer;
border-radius: 15px;
border: 2px solid #777777;
}
.hospitals:hover{
background: #000000 url("../view/images/hospitalsyellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.hotel:hover{
background: #000000 url("../view/images/hotelyellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.car:hover{
background: #000000 url("../view/images/caryellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.realty:hover{
background: #000000 url("../view/images/realtyyellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.weight:hover{
background: #000000 url("../view/images/weightlossyellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.furniture:hover{
background: #000000 url("../view/images/furnitureyellow.png") top center no-repeat;
border: 2px solid #fedd00;
height: auto;
}
.blockspan{
margin-top: 145px;
float: left;
width: 200px;
display: block;
line-height: 35px;
font-family: url('asenine'), arial, helvetica, sans-serif;
font-size: 170%;
text-align: center;
color: white;
}
.blockmenu{
background: #000000;
width: 200px;
height: 0;
list-style-type: none;
position: absolute;
text-decoration: none;
padding: 0;
z-index: 100;
display: block;
margin-top: 175px;
}
/* .blockmenu li{
text-decoration: none;
float: left;
width: 200px;
display: block;
line-height: 35px;
font-family: url('asenine'), arial, helvetica, sans-serif;
font-size: 170%;
text-align: center;
color: white;
border-radius: 15px;
z-index: 1000;
position: relative;
line-height: 35px;
} */
.blockmenu li{
text-decoration: none;
height: 30px;
float: left;
width: 200px;
display: block;
line-height: 35px;
font-family: url('asenine'), arial, helvetica, sans-serif;
font-size: 100%;
text-align: left;
color: white;
border-radius: 15px;
z-index: 1000;
position: absolute;
line-height: 35px;
text-align: left;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-webkit-transition: height .1s linear;
-moz-transition: height .1s linear;
border-radius: 15px;
}
.blockmenu ul{
float: left;
width: 200px;
display: block;
font-family: url('myriad-pro-light'), arial, helvetica, sans-serif;
font-size: 40%;
text-align: left;
list-style: circle;
opacity: 0;
margin-top: -5px;
font-weight: lighter;
}
.blockmenu li a{
text-decoration: none;
text-align: left;
list-style: circle;
color: white;
opacity: 0;
width: 200px;
}
/* -------------------------- HOVER HOSPITALS ---------------------------------*/
.hospitals:hover span{
color: #fedd00;
}
.hospitals:hover{
height: 250px;
}
.hospitals:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.hospitals:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.hospitals .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
}
/* -------------------------- END HOSPITALS ---------------------------------*/
/* -------------------------- HOVER CAR ---------------------------------*/
.car:hover span{
color: #fedd00;
}
.car:hover{
height: 220px;
}
.car:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.car:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.car .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
}
/* -------------------------- HOVER REALTY ---------------------------------*/
.realty:hover span{
color: #fedd00;
z-index: 9999;
position: absolute;
}
.realty:hover{
height: 280px;
}
.realty:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.realty:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.realty .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
position: absolute;
}
/* -------------------------- HOVER WeightLoss ---------------------------------*/
.weight:hover span{
color: #fedd00;
z-index: 9999;
position: absolute;
}
.weight:hover{
height: 250px;
}
.weight:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.weight:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.weight .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
position: absolute;
}
/* -------------------------- HOVER furniture ---------------------------------*/
.furniture:hover span{
color: #fedd00;
}
.furniture:hover{
height: 220px;
}
.furniture:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.furniture:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.furniture .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
}
/* -------------------------- HOVER HOTELS ---------------------------------*/
.hotel:hover span{
color: #fedd00;
}
.hotel:hover{
height: 220px;
}
.hotel:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.hotel:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.hotel .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
}
/* -------------------------- END HOTELS ---------------------------------*/
/* -------------------------- HOVER HOTELS ---------------------------------*/
.hotel:hover span{
color: #fedd00;
}
.hotel:hover{
height: 220px;
}
.hotel:hover .blockmenu li a{
opacity: 1;
z-index: 1;
position: absolute;
}
.hotel:hover .blockmenu li{
height: 30px;
line-height: 30px;
z-index: 1;
position: relative;
display: block;
}
.hotel .blockmenu a:hover{
color: #fedd00;
height: 30px;
z-index: 1;
}
/* -------------------------- END HOTELS ---------------------------------*/
#bottomexperiences{
width: 100%;
position: absolute;
margin: -600 auto;
height: 600px;
opacity: 0;
z-index: -999;
}
.openmorebutton{
margin: 0 auto;
width: 100%;
}
.openmorebutton img:hover{
cursor:pointer;
}
#inbannergrid{
width: 715px;
margin: 0px auto;
position: relative;
}
#open{
margin: 0 auto;
width: 300px;
height: 40px;
color: white;
border-radius: 12px;
display: block;
position: relative;
font-size: 130%;
font-weight: normal;
cursor: pointer;
border: 2px solid white;
background: none;
z-index: 9999;
}
#open:hover{
color: #fedd00;
border: 2px solid #fedd00;
}
#explanation{
font-size: 135%;
text-align: center;
width: 750px;
margin: 0 auto;
display: block;
font-family: url('myriad-pro-light'), arial, helvetica, sans-serif;
}
#exitbutton{
position: absolute;
top: 20px;
right: 20px;
background: url("../view/images/exit.png") top center no-repeat;
}
Ok your code it's really a mess (i'm kidding maybe you have no experience) but i tried to clean this and make an example it's a little mess but i try to maintain your code. Look specially at the CSS all you have to do now is duplicate some specific class for each one of your items and make changes in html. I hope it can be a good guide for you.
http://jsfiddle.net/cy3VF/53/
The primary error was handling of :hover you don't have to modify the height of your divs, you only have to manage the
display:block and display:none
Aditional, to the use of
position:absolute
make sure that his parent has
position:relative