I have created a grid. Each item in this grid has a drawer menu coming out of it downwards on hover. What happens on hover is that all items below get pushed down, i want only the item directly underneath to push down.
Url to this site: http://esgu.no/dev/unicef/menupage.htm
My HTML
<div class="grid alef">
<div class="card w33">
<img src="assets/3.jpg">
<div class="orange subm">
Barns rettigheter
</div>
<ul class="acti obord">
<li>Historie</li>
<li>Barnas rettigheter i Norge</li>
</ul>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="pink subm">
Unicef og barn i verden
</div>
<ul class="acti pbord">
<li>Dette er unicef</li>
<li>Fakta om barn</li>
<li>Barnearbeid</li>
</ul>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="green subm">
Unicef-runden
</div>
<ul class="acti gbord">
<li>Meld på skolen</li>
<li>Bilder fra runden</li>
</ul>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="lblue subm">
FN´s bærekraftsmål
</div>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="red subm">Til deg som er fadder</div>
<ul class="acti rbord">
<li>Faddertips</li>
<li>Faddertesten</li>
<li>Fadderquiz</li>
<li>Aktivitetshjul</li>
<li>Fadderrebus</li>
<li>Fadderkryssord</li>
</ul>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="yellow subm">
Kryssord og andre nøtter
</div>
<ul class="acti ybord">
<li>Kryssord</li>
<li>Puslespill</li>
<li>Rebus</li>
</ul>
</div>
<div class="card w33">
<img src="assets/3.jpg">
<div class="dblue subm">
Du kan
</div>
</div>
</div>
My grid CSS
.grid{width:100%;margin:0 auto;padding:40px 10%;font-size:0;text-align:center}.grid > li{width:auto;height:auto;padding:0}
.grid > *{display:inline-block;vertical-align:top;width:100%;font-size:14px;font-size:1rem;padding:20px}
The only way I can think of, is to create 3 UL's and float them left, with a 33.3% width each. Each LI would then be 100%, stacking on top of each other. When you hover over one, it will only push down that UL.
This may not be a valid solution for you but may be an avenue worth exploring!
See this for a quick example - http://codepen.io/conormcafee/pen/MKgdZg
<ul>
<li>Link</li>
<li>Link</li>
<li>Link</li>
</ul>
<ul>
<li>Link</li>
<li>Link<span>Show me</span></li>
<li>Link</li>
</ul>
<ul>
<li>Link</li>
<li>Link</li>
<li>Link</li>
</ul>
ul {
display: block;
float: left;
width: 33.3%;
}
li span {
display: none;
color: red;
}
li:hover span {
display: block;
}
Related
my html page has this unwanted white patch in the bottom and I don't know why. I don't want to be able to scroll down that long. It stays there regardless by default. it dissapears when I hover on the left(front) element but reappears when I hover on the right(behind) element.
here is the codepen : https://codepen.io/aronnora/pen/ExjJrag
<nav class="nav_bar">
<img src="580b57fcd9996e24bc43c4f8.png" alt="logo" class="logo" id="logo">
<div class="trans" id="trans"> trans energy solutions </div>
<ul class="ul">
<li class="li1">Home</li>
<li class="li2">About Us</li>
<li class="li3">Products</li>
<li class="li4">Services</li>
<li class="li5">Facility</li>
<li class="li6">Testing</li>
<li class="li7">Clients</li>
<li class="li8">Contact</li>
</ul>
</nav>
<div class="white">
</div>
<div class="pro">
<div class="text">
PRODUCTS
</div>
</div>
<div class="total">
<div class="one">
<img src="liquid-immersed-distribution-transformers-768x784.png" alt="kakashi" class="Kakashi" height="300rem"></img>
<div class="downtextone">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不注更ルモト点究サトケ別意マワ抜博写ミ元
</div>
</div>
<div class="two">
<img src="transtech-2.png" alt="madara" class="Madara" height="300rem"></img>
<div class="downtexttwo">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不
</div>
</div>
</div>
your div takes a default height as it's content. so just add overflow:hidden; to class (.tow)
.two {
height: 58.29rem;
width: 45rem;
transition: opacity 1s;
background-color: black;
position: absolute;
z-index: 10;
overflow: hidden;
}
White row appeared below main menu and above jumbotron on a drupal site. I am unable to remove it.
I think that it is css problem but I can't find what exactly causing it. Here is the link to codepen: https://codepen.io/lomachx/pen/WNbLgYa
<body class="html front not-logged-in no-sidebars page-node i18n-ru">
<div id="skip-link" class="skip-link">
Skip to main content
</div>
<div class="menu-wrap">
<div class="full-wrap logo-wrap"><!--c-->
<div id="logo">
<img src="img/logo.png"/>
</div>
<h1 id="site-title">
Cool Site
</h1>
<nav id="main-menu" role="navigation">
<a class="nav-toggle" href="#">Navigation</a>
<div class="menu-navigation-container">
<ul class="menu"><li class="first leaf">Main</li>
<li class="leaf">Articles</li>
<li class="last leaf">About</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="header"><!--c-->
<div class="homebanner">
</div>
<!--New navbar -->
<div>
<nav class="navbar-lower" role="navigation">
<div class="region region-second-menu">
<div id="block-system-navigation" class="block block-system block-menu">
<div class="content">
<ul class="menu">
<li class="first last leaf">Главная</li>
</ul>
</div>
</div> <!-- /.block -->
</div>
</nav>
</div>
</div>
<div class="bckgr-wrap">
<div><H1>Nest</H1></div>
</div>
</body>
</html>
Change body margin-top:50px to the height of your header like below
css
body {
color: #333;
background: #fff;
background-size: cover;
font-family: 'Philosopher', sans-serif;
font-size: 14px;
line-height: 180%;
margin-top: 35px;
}
I'm using Bootstrap and my issue is that the content (ul) within the "forecastDiv" is not inside the "forecastDiv" border. The content stays inside the border once I remove Bootstrap's grid system but I need to align my content properly so I need to be using the grid system. Below is the code I have in a codepen (go to "6-day forecast" comment in HTML). Any help is appreciated. Thank you.
HTML
<div id="forecastDiv">
<div class="col-md-1" id="boxInfo0">
<p id="forecast0">0
</p>
<p id="forecast0TempC">0
</p>
<p id="day0">Test
</p>
</div>
<div class="col-md-1" id="boxInfo1">
<p id="forecast1">0
</p>
<p id="forecast1TempC">0
</p>
<p id="day1">Test
</p>
</div>
<div class="col-md-1" id="boxInfo2">
<ul id="forecast2">0
</ul>
<ul id="forecast2TempC">0
</ul>
<ul id="day2">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo3">
<ul id="forecast3">0
</ul>
<ul id="forecast3TempC">0
</ul>
<ul id="day3">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo4">
<ul id="forecast4">0
</ul>
<ul id="forecast4TempC">0
</ul>
<ul id="day4">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo5">
<ul id="forecast5">0
</ul>
<ul id="forecast5TempC">0
</ul>
<ul id="day5">Test
</ul>
</div>
</div> <!-- end forecastDiv -->
CSS
#forecastDiv {
width: 100%;
border: solid black;
margin: 0 auto; }
https://codepen.io/mcmaster-99/pen/ybWvyy
add a "container" or "container-fluid" class to your <div id="forecastDiv">. "container" is a bootstrap class that will keep everything inside the div.
<div class="container" id="forecastDiv">
My pen: http://codepen.io/helloworld/pen/yyoJGR
Why is the white separater and the list-grouping flowing through the divs or the parent row?
<div class="container columnStyle">
<div class="row">
<div class="row-same-height">
<div class="col-xs-3 col-xs-height">
<img class="img-responsive" src="http://s7.postimg.org/agarkavmj/whoiswho.png"></img>
</div>
<div class="col-xs-9 col-xs-height" >
<div class="container">
<div class="row">
<div class="page-header">
<h1>Who is who
<p>
<small>Organization & Processes</small>
</p>
</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<ul class="list-group">
<li class="list-group-item">Org Charts </li>
<li class="list-group-item">GAM / KAM Charts</li>
<li class="list-group-item">Process flow</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
.columnStyle{
background: #006AB3;
}
Because you use the class .containermultiple times.
This class has a fixed width of 1170px;
.container {
width: 1170px;
}
you should have only 1 .containerfor the wrapper and then, inside of it, remove the other .container and just use .row
See it in action : http://codepen.io/anon/pen/ogeLRb
I have a list that I want to fill the width of the container but there seems to be a small gap at the end for some reason.
The CSS is lengthy so here is the html
<div class="line clearfix no-margin">
<div class="container">
<header>
<div class="logo col-4">
<img src="#" />
<h1 class="logo">Name</h1>
</div>
<div class="nav clearfix">
<ul>
<li><span id="head-icon"></span>About Us</li>
<li><span id="wrench-icon"></span>Services</li>
<li><span id="email-icon"></span>Contact</li>
</ul>
</div>
</header>
</div>
</div>
Demo
I can't seem to figure out where that gap is coming from.
It's because of the margin-left: -3px; in .nav li!
See the updated Fiddle: http://jsfiddle.net/VRtnA/18/
Try removing margin-left: -3px; in .nav li.