The website should have a maximum width of 1300px and three columns: left, content and right.
All columns should be individually scrollable.
The left and right columns should disappear to the outside after the button is pressed.
Most of it already works, but I can't find a solution for the following:
the right column is outside the page (max-width is ignored?)
All three columns behave differently when they are fade out;
right is good, left is too fast and content jumps and does not fade
/* dont display the checkboxes */
#nav_toggle_right,#nav_toggle_left{
position:absolute; opacity:0; display:none
}
/* more useless space */
ul li{
line-height: 8;
}
/* left button */
#nav_toggle_left~label.nav_toggle_left {
position:fixed;
display:block;
cursor:pointer;
text-align:center;
z-index:300;
font-size:28px;
width:40px;
height:40px;
top:9px;
left:20px;
line-height:40px;
}
#nav_toggle_left~label .lable_before {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px solid #000000;
border-radius:10px;
}
#nav_toggle_left~label .lable_after {
display:none;
}
#nav_toggle_left:checked~label .lable_before{
display:none;
}
#nav_toggle_left:checked~label .lable_after {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px solid #000000;
border-radius:10px;
}
#nav_toggle_left:checked~.menu_left {
-webkit-transform:translateX(-100vw);
transform:translateX(-100vw)
}
/* right button */
#nav_toggle_right~label.nav_toggle_right {
position:fixed;
display:block;
cursor:pointer;
text-align:center;
z-index:300;
font-size:28px;
width:40px;
height:40px;
top:9px;
right:20px;
line-height:40px;
}
#nav_toggle_right~label .lable_before {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px #000000);
border-radius:10px;
}
#nav_toggle_right~label .lable_after {
display:none;
}
#nav_toggle_right:checked~label .lable_before{
display:none;
}
#nav_toggle_right:checked~label .lable_after {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px #000000);
border-radius:10px;
}
#nav_toggle_right:checked~.menu_right {
-webkit-transform:translateX(290px);
transform:translateX(290px)
}
/* widht of page */
.page{
max-width:1050px;
}
/* left menu */
.menu_left{
height:100%;
width:250px;
background-color:#f5f5f5;
border-right:solid 1px #c9c9c9;
inline-height:20px;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
left:0px;
top:0px;
position:fixed;
}
/* right menu */
.menu_right{
height:100%;
width:250px;
background-color:#e3e3e3;
border-left:solid 1px #c9c9c9;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
right:0px;
top:0px;
position:fixed;
}
/* content */
.content{
height:1000vh;
min-width:300px;
background-color:#FCFCFC;
scrollbar-width:none;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
margin-left:250px;
margin-right:250px;
padding:20px 20px 20px 20px;
}
/* content without menu(s) */
#nav_toggle_left:checked~.content{
margin-left:0px!important;
}
#nav_toggle_right:checked~.content{
margin-right:0px!important;
}
/* same transition for both menues */
.transition{
-webkit-transition:1.53s transform;
transition:1.53s transform;
-webkit-transition-timing-function:cubic-bezier(.38,.52,.37,1);
transition-timing-function:cubic-bezier(.38,.52,.37,1);
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">
<div class="page">
<input type="checkbox" id="nav_toggle_left">
<label class="nav_toggle_left" for="nav_toggle_left">
<span class="lable_after">
<i class="fa fa-bars"></i>
</span>
<span class="lable_before">
<i class="fa fa-times"></i>
</span>
</label>
<div class="menu_left transition">
<ul>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
</ul>
</div>
<input type="checkbox" id="nav_toggle_right">
<label class="nav_toggle_right" for="nav_toggle_right">
<span class="lable_after">
<i class="fa fa-list"></i>
</span>
<span class="lable_before">
<i class="fa fa-times"></i>
</span>
</label>
<div class="menu_right transition">
<ul>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
</ul>
</div>
<div class="content">
<i class="fa fa-list"></i>
<i class="fa fa-times"></i>
<i class="fa fa-bars"></i>
If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?. If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?. Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy. Twitter is the rice of social media. Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy. A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road. Why don't we call glasses duocles. North America should be called Russia since people are always moving so fast. Gralitica. We need more werkin and less twerkin if you ask me. Balooby. I started a sensory deprivation chamber business - it involves really dark curtains, ear plugs, and a sleeping mask. To Catch A Predator would have been a great name for a Steve Irwin show. Mintslavicia. North America should be called Russia since people are always moving so fast. Gralitica. Most streets are two-way streets...why does that make love so special?. Thank you for using my words in your work. Twitter is the rice of social media.
</div>
</div>
Or a codepen
Maybe you could use flex-grow/flex-shrink.
https://css-tricks.com/almanac/properties/f/flex-shrink/
You can get a consistent transition using it.
Some examples given on this Question/Answers
Transition flex-grow of items in a flexbox
Related
I using a mobile menu for my website which is dropping down from the top to the bottom. Is their a way to get it open from the left, like the sidebar does? I'm not that familiar with css animation and I tried transform: rotate(90deg); but without any effects.
The mobile menu is visible here https://www.amaoni.de
it can be easily done by using ul,li tags
ul,li{
list-style:none;
padding:0px;
margin:0px;
}
#yourMenu{
border:1px solid #000;
height:200px;
width:30%;
}
#yourMenu>li{
width:100%;
padding:5px;
background-color:blue;
box-sizing:border-box;
color:#fff;
}
#yourMenu>li:hover{
cursor:pointer;
background-color:red;
}
<ul id="yourMenu">
<li>menu 1</li>
<li>menu 2</li>
<li>menu 3</li>
</ul>
I have a div with this style:
#menudiv{
width:20%;
padding:3px;
float:left;
height:100%;
font-family:ubuntu;
font-size:25px;
color:#404040;
}
The problem is that although the div is placed correctly and has the right visual attributes, the content in this div is disabled. As in, the data cannot be selected with click-moving the mouse and the links in this place are unclickable :S
What am I doing wrong here?
P.s. there are two other divs in this section of the page which these styles:
#content{
position:relative;
}
div.sidebar{
float:right;
margin-right:25px;
margin-left:5px;
padding:5px;
font-family:verdana;
font-size:10pt;
width:300px;
border:solid 2px #a0b0c0;
display:flex;
text-align:justify;
}
The content in these divs is normal and can be interacted with.
The content in the div is this:
<div id="menudiv">
<img class="titleico" src="images/home.png" /> HOME<br />
<ul id="menulist">
<li>Menu item 1</li>
<li>Menu item 2</li>
</ul>
</div>
UPDATE 2
You can check the whole thing # http://daera.net/daera
The leftmost div (the one with HOME text and 2 list items) has the problem.
If your HTML/CSS/Javascript/JQuery code contains the following, please remove them...
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select:none;
user-select:none;
-o-user-select:none;
unselectable="on"
onselectstart="return false;"
onmousedown="return false;"
Option 1
remove this block from the code
#contentdiv {
position: relative;
}
Option 2
#contentdiv {
position: relative;
float: left;
width: 200px; // give what ever required
}
issue will be resolved
i am trying to create a menu bar with list items.i applied css for the list items.i want all of them to lie on a single line i mean when zoom in to 500% and zoom out to 25% all the list items should be in same line.but in my implementation they are going out of the line.i'm a beginner please help me
css:
.menu
{
margin-top:5px;
margin-bottom:5px;
background-color:#4c4c4c;
color:white;
position:relative;
display:inline-block;
text-align:center;
padding:0px 85px 0px 85px;
border:2px solid #4c4c4c;
}
#menuitem1
{
border-top-left-radius:5px;
border-bottom-left-radius:5px;
text-align:center;
margin:auto;
}
#menuitem4
{
border-top-right-radius:5px;
border-bottom-right-radius:5px;
}
<html>
<body >
<div id="page">
<div id="bar">
<ul>
<li class="menu" id="menuitem1" >Home</li>
<li class="menu">contact us</li>
<li class="menu">pay</li>
<li class="menu" id="menuitem4" >plans</li>
</ul>
</div>
</div>
</body>
</html>
jsfiddle
Set the width of the .menu in percentage so the li's are responsive.
JSFIddle
HTML
<body >
<div id="page">
<div id="bar">
<ul>
<li class="menu" id="menuitem1" >
Home
</li>
<li class="menu">
contact us
</li>
<li class="menu">
pay
</li>
<li class="menu" id="menuitem4" >
plans
</li>
</ul>
</div>
</div>
</body>
CSS
.menu
{
margin-top:5px;
margin-bottom:5px;
background-color:#4c4c4c;
color:white;
position:relative;
display:inline-block;
text-align:center;
padding:0px 0px 0px 0px;
border:2px solid #4c4c4c;
width:20%;
}
#menuitem1
{
border-top-left-radius:5px;
border-bottom-left-radius:5px;
text-align:center;
margin:auto;
}
#menuitem4
{
border-top-right-radius:5px;
border-bottom-right-radius:5px;
}
You can try using percentage width values for width of your li elements.
.some-class {
width: 25%
}
I've made some changes on jsfiddle just to show it is possible with this kind of implementation.
If you are concerned about mobile devices. Take a look at meta tags with device-width.
You can add:
ul {
white-space: nowrap;
}
to prevent wrapping -> jsfiddle
I've started to add a drop down menu to my 2nd nav bar (the one in blue) but before I've really got started the main links are moving around and the content in separate divs underneath are also moving around but I've no idea why?
Here's a jsfiddle link http://jsfiddle.net/zDGHg/
I'm new to html and css so any help would be much appreciated.
Related code
HTML
<!--BOTTOM NAVIGATION BAR-->
<div id="botnavbar">
<nav id="botnavlinks">
<ul>
<li>Travel Boards</li>
<li>Destinations
<ul>
<li>sdfgsdfd</li>
<li>sdfgsdfd</li>
<li>sdfgsdfd</li>
<li>sdfgsdfd</li>
</ul>
</li>
<li>Activities</li>
<li>Thingstodo</li>
<li>Accomodation</li>
<li>Transport</li>
</ul>
</nav>
</div>
<!--CONTENT---->
<div id="content">
<div id="slidemenus">
<h1>Filter By</h1>
<!--Put content here-->
<ol>
<li>Price per Trip</li>
<li>Duration</li>
<li>Departure Date</li>
<li>Travel Styles</li>
<li>Activities</li>
<li>City</li>
<li>Country</li>
</ol>
</div>
<div id="featured">FEATURED CONTENT
<!--Put content here-->
<ol>
<li>product info</li>
</ol>
</div>
</div>
CSS
#botnavbar{
height:40px;
background: -webkit-linear-gradient(#6880af, #314a79); /* For Safari */
background: -o-linear-gradient(#6880af, #314a79); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#6880af, #314a79); /* For Firefox 3.6 to 15 */
background: linear-gradient(#6880af, #314a79); /* Standard syntax (must be last) */
}
#botnavlinks{
min-width:960px;
margin: 0 auto;
text-align:left;
padding-left:200px;
}
#botnavlinks ul{
list-style:none;
height:35px;
}
#botnavlinks li{
height:35px;
float:left;
padding-right: 60px;
}
#botnavlinks li a:link, a:visited{
display:block;
color:#fff;
font-family:Papyrus;
padding:8px;
text-decoration:none;
text-shadow:0 -1px 1px rgba(0,0,0,0.5); /*For embossed effect*/
text-align:center;
}
#botnavlinks li a:hover{
background-color:#1d3564;
}
#content{
height:500px;
background-color:#fff;
}
#slidemenus{
border:solid black 1px;
width:30%;
min-height:500px;
float:left;
}
#featured{
border:solid black 1px;
width:60%;
min-height:500px;
float:left;
}
In your jsfiddle, check the width of your #botnavlinks ul declaration... it's set to 150px. If you set it to a wider width or auto, then your links should look as they should.
Also, when you define something to 0 (e.g. margin: 0px), you don't need to specify the units; this will suffice: margin: 0;
Hope that helps.
Edit:
Also, I forgot to mention that other things affecting your menu bar is the padding left you have for your list items (200px); since you have a 'min-width: 960px' defined in your #botnavlinks declaration, and 6 list items (6 x 200 = 1200px wide), the elements will naturally wrap. ;)
I have a <ul> of items, who get bigger (with animation) on hover. Now i have made them be on the right side of the screen (using the CSS right:0em for the <li> class), and I have set the position of the <li> on hove to fixed so that only it will move left as it grows, and all the over objects in the will stay to the right. The problem is that as a result of that, when I hover over it, the next item gets "under" it. How can I change that? (maybe is there a way to control only the horizontal position property of the <li> on hover?)
Code:
http://jsfiddle.net/KBprd/2/
Without any code to start it is kind of hard to help. But based on what I could gather, you are wanting all the items to stay flush against the right side of the menu; only the "hovered" element is moved away from the right-side of the container. I've slapped together an example of how to do this. If this is not what you are looking for, provide some more code or detail in comments and we can go from there...
Here is the updated Fiddle
CSS:
.navigation{
position:fixed;
z-index:1;
top:3em;
right:0em;
}
.navigation li.slide{
color:#000000;
display:block;
padding: 0 10px;
line-height:30px;
margin-bottom:2px;
font-weight:light;
background:#00C9FF;
-webkit-transition: all .2s ease-in-out;
text-align:right;
width:53px;
float:right;
}
.navigation li:hover,.active{
font-size:25px;
cursor:pointer;
width:100px!important;
background:#5C0CE8;
}
.navigationClear {
clear:both;
height:1px;
margin-bottom:-1px;
}
HTML:
<ul class="navigation">
<li data-slide="1" class="slide">Slide 1</li>
<li class="navigationClear"></li>
<li data-slide="2" class="slide">Slide 2</li>
<li class="navigationClear"></li>
<li data-slide="3" class="slide">Slide 3</li>
<li class="navigationClear"></li>
<li data-slide="4" class="slide">Slide 4</li>
<li class="navigationClear"></li>
</ul>
The reason that your hovered element hides the element below is because you have given "position:fixed" to the hovered element. I fixed your problem by giving the ul element a width so that the li elements wont line up. I also removed the fixed position of the hovered element. and then right floated the li. This way you also dont need to put "clearNavigation" after each element.
Here's your fiddle code.
<ul class="navigation">
<li data-slide="1">Slide 1</li>
<li data-slide="2">Slide 2</li>
<li data-slide="3">Slide 3</li>
<li data-slide="4">Slide 4</li>
.navigation{
position:fixed;
z-index:1;
top:3em;
right:0em;
width:53px;
}
.navigation li{
color:#000000;
display:block;
padding: 0 10px;
line-height:30px;
margin-bottom:2px;
font-weight:light;
background:#00C9FF;
-webkit-transition: all .2s ease-in-out;
text-align:right;
width:53px;
position:relative;
right:0em;
float:right;
}
.navigation li:hover,.active{
font-size:25px;
cursor:pointer;
width:100px!important;
background:#5C0CE8;
right:0em;
}