I ran into a problem which I need to solve to present the Website.
The border when I hover my menu isn't moving upwards, only my font moves up a bit.
.srt-menu li a {
transition: 0.3s ease;
background: #3fa46a;
color: red;
font-size: 20px;
text-decoration: none;
padding: 0px 0;
margin: 0 0px;
}
.srt-menu li a:hover{
transition: 0.3s ease;
background: transparent;
color: #1aa8a4;
text-decoration: none;
border-top: 1px solid red;
border-bottom: 4px solid #3fa46a;
padding: 0px 0;
margin: 0 0px;
}
.srt-menu li li a {
background:#e8e8e8;
padding-left:40px;
}
.srt-menu li li li a {
background:#efefef;
padding-left:80px;
}
/*SECONDARY MENU*/
#secondary-navigation{
margin-bottom:60px;
}
``#secondary-navigation ul{
margin:0;
padding:0;
}
#secondary-navigation ul li a{
background:#E6E6E6;
display:block;
margin:5px 0;
padding:10px;
text-decoration:none;
}
#secondary-navigation ul li a:hover,
#secondary-navigation ul li.current a{
transition: 0.3s ease;
background: red;
color: #ffffff;
text-decoration: none;
border-top: 0px solid transparent;
border-bottom: 4px solid #3fa46a;
padding: 24px 0;
}
/*SPACE GRID ELEMENTS VERTICALLY, SINCE THEY ARE ONE UNDER ANOTHER SO FAR*/
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12 {
margin-bottom:40px;
/*positioning and padding*/
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
/*FOOTER*/
footer{
clear:both;
font-size:80%;
padding:20px 0;
}
footer ul{
margin:0;
padding:0;
}
/*colors and backgrounds*/
body{
background:#fff;
}
h1, h2, h3, h4, h5, h6{
color:#333;
}
footer{
background:#333;
color:#ccc;
}
footer h1, footer h2, footer h3, footer h4{
color:#CCC;
margin-bottom:10px;
}
footer ul{
margin:0 0 0 8%;
}
a.buttonlink{
background:#0099ff;
border-radius:7px;
color:#fff;
display:block;
float:left;
margin:10px 15px 10px 0;
padding:10px;
text-decoration:none;
}
a.buttonlink:hover{
background:#8dbc01;
}
.greenelement{
background:#5ec79e;
color:#fff;
}
.violetelement{
background:#887dc2;
color:#fff;
}
/* Contain floats*/
.clearfix:before,
.clearfix:after,
.row:before,
.row:after {
content: " ";
display: table;
}
.clearfix:after,
.container:after,
.row:after{
clear: both;
}
aside {
float:right;
width:30%;
}
/*** MAIN MENU - ESSENTIAL STYLES ***/
.menu-toggle{display:none;}
#menu-main-navigation{display:block;}
.srt-menu, .srt-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.srt-menu ul {
position: absolute;
display:none;
width: 12em; /* left offset of submenus need to match (see below) */
}
.srt-menu ul li {
width: 100%;
}
.srt-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.srt-menu li {
float: left;
position: relative;
margin-left:1px;
}
.srt-menu li li {
margin-left:0px;
}
.srt-menu a {
display: block;
position: relative;
}
.srt-menu li:hover ul,
.srt-menu li.sfHover ul {
display:block;
left: 0;
top: 45px; /* match top ul list item height */
z-index: 99;
-webkit-box-shadow: 2px 3px 2px 0px rgba(00, 00, 00, .3);
box-shadow: 2px 3px 2px 0px rgba(00, 00, 00, .3);
}
ul.srt-menu li:hover li ul,
ul.srt-menu li.sfHover li ul {
top: -999em;
}
ul.srt-menu li li:hover ul,
ul.srt-menu li li.sfHover ul {
left: 12em; /* match ul width */
top: 0;
}
ul.srt-menu li li:hover li ul,
ul.srt-menu li li.sfHover li ul {
top: -999em;
}
ul.srt-menu li li li:hover ul,
ul.srt-menu li li li.sfHover ul {
left: 10em; /* match ul width */
top: 0;
}
/*** DEMO1 SKIN ***/
#topnav, .srt-menu {
float:right;
margin: .35em 0 0 0;
}
.srt-menu a {
text-decoration:none;
}
.srt-menu li a {
background:#fff;
margin:0;
padding:10px 20px;
height:45px;
}
.srt-menu a, .srt-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
color: #0099ff;
}
.srt-menu li li a {
border-top: 1px solid rgba(255,255,255,.2);
background: #333; /*fallback for old IE*/
background:rgba(0,0,0,.6);
color: #fff;
padding-left:20px;
height:auto;
}
.srt-menu li li a:visited{color:#fff;}
.srt-menu li li li a,
.srt-menu li.current * li a{
padding-left:20px;
background:rgba(0,0,0,.6);
}
.srt-menu li:hover > a,
transition: 0.3s ease;
background: transparent;
color: #1aa8a4;
text-decoration: none;
border-top: 0px solid transparent;
border-bottom: 4px solid #3fa46a;
padding: 24px 0;
}
.srt-menu li li:hover > a{
color:green;
background:#0099ff;
}
<nav id="topnav" role="navigation">
<div class="menu-toggle">Menu</div>
<ul class="srt-menu" id="menu-main-navigation"><li class="current">Start<ul><li>Test</li></ul></li><li>Kontakt</li><li>Öffnungszeiten</li><li>Anfahrt</li><li>testststst</li></ul> </nav><!-- #topnav -->
<!-- main content area -->
<div class="wrapper" id="main">
Take a look on my website where you can see the problem in action.
How can I create the menu look like here?
I want the bottom border to move in when I hover on it, and move out when I leave the "button".
The example you are trying to copy is not structured the same way your site is.
On :hover, You can simply add a box-shadow for the bottom:
box-shadow: 0 4px 2px -2px gray;
Related
I'm concluding a design and I'm facing an issue which I'm not familiar with. I'm trying to make a menu expand from hidden to visible over 2 seconds on hover using a transition: height CSS element.
The issue is that the ul is obeying the transition and appearing visible within 2s, however the lis are completely ignoring the transition effect and instantly expanding on hover.
CSS syntax below:
#main_navbar_container{
margin-bottom:0;
background:white;
}
.navbar-collapse {
text-align:center;
}
#menu_container{
width:80%;
float:right;
display:block;
}
#primary_menu{
display:block;
float:left;
width:100%;
}
#primary_menu ul{
list-style: none;
margin: 0;
padding-left: 0;
}
#primary_menu a,
#primary_menu a:visited,
#primary_menu a:link{
color:#ea474b;
font-weight: 600;
display: block;
text-decoration: none;
padding: 15px 20px;
margin:auto;
}
#primary_menu a:hover{
color:#F9690E;
}
#primary_menu li{
float:left;
position:relative;
margin:0
}
#primary_menu ul ul {
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
border-radius: 4px;
border: 1px solid #dadada;
background: #fff;
color: #8c9398;
float: right;
position: absolute;
top: 3.5em;
right: -999em;
z-index: 99999;
text-align: center
}
#primary_menu ul li:hover > ul {
right: 50%;
margin-right: -100%;
width: 200px;
}
.sub-menu li{
margin:0 15px !important;
}
#primary_menu ul li ul a{
color:#ea474b;
}
#primary_menu ul li ul:hover a{
color:#ea474b;
}
#primary_menu ul li ul li:hover a{
color:#F9690E;
}
#media (max-width: 1200px){
#main_navbar_container .container, #menu_container { width: 100%;}
#menu_container .navbar-collapse { padding: 0;}
#primary_menu{
width:100%;
margin:0;
}
#primary_menu li{
width:100%;
margin:5px 0 0 0;
}
#primary_menu ul li ul {
border-radius: 0 !important;
border-color: transparent !important;
display:hidden;
height:100px;
-webkit-transition: height 2s; /* Safari */
transition: height 2s;
}
#primary_menu ul li:hover{
background:none;
}
#primary_menu ul li:hover a{
font-color:black;
/*\color:rgb(207,0,15);*/
}
#primary_menu ul li:hover ul{
position:initial;
display:block;
background-color:rgb(238,238,238);
width:100%;
padding:0;
margin:0;
height:400px;
}
#primary_menu ul li:hover li:first-of-type{
border-top:1px solid rgb(238,238,238);
}
#primary_menu ul li:hover li:last-of-type{
border-bottom:1px solid rgb(238,238,238);
}
#primary_menu ul li:hover a:link,
#primary_menu ul li:hover a:visited{
color:#ea474b;
}
#menu-home-screen-menu{
margin-left:0;
}
}
Here is a fiddle: http://jsfiddle.net/x15jw967/
A few things help here. First, transition max-height instead of height to allow variation:
#primary_menu ul li ul {
...
max-height:0;
-webkit-transition: max-height 2s;
transition: max-height 2s;
}
#primary_menu ul li:hover ul {
...
max-height: 400px;
}
Then, set overflow to hidden so the outer content doesn't show:
#primary_menu ul li ul {
...
overflow: hidden;
}
Demo
Here's a simplified demo in which the close transition works also. You can add your styling back in and see what breaks it.
I have a very strange responsive issues on my prestashop site on the top menu block. Can you please help me solve it?
Only happens on media width 600px, the problem is that the menu subcategories are dropped down automatically by themselves. I do not know why and do not know how to solve it...
Here is the code
/*** ESSENTIAL STYLES ***/
.sf-contener {
clear: both;
}
.sf-right {
margin-right: 14px;
float: right;
width: 7px;
}
.sf-menu, .sf-menu * {
margin: 0;
padding: 0px 0px 0px 0px;
list-style: none;
}
.sf-menu {
margin: 10px 0;
padding:0px 0px 0px 0px;
width:980px;/* 980 */
background: #383838;
/* #media (max-width: 450px) {
.sf-menu {
display: none; } */
}
.sf-menu ul {
position: absolute;
top: -999em;
width: 10em; /* left offset of submenus need to match (see below) */
}
.sf-menu ul li {
width: 100%;
}
.sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
float: left;
position: relative;
top: 0;
/*border-right: 1px solid #777;*/
}
.sf-menu a {
display: block;
position: relative;
color:#fff;
}
.sf-menu li:hover ul,
.sf-menu li.sfHover ul {
left: 0;
/*padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;*/
top: 35px; /* match top ul list item height */
z-index: 99;
width:auto;
}
ul.sf-menu li:hover li ul,
ul.sf-menu li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
left: 200px; /* match ul width */
top: 0;
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
left: 200px; /* match ul width */
top: 0;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
left: 200px; /* match ul width */
top: 0;
}
/*** DEMO SKIN ***/
.cat-title {
display: none;
}
.sf-menu {
float: left;
margin-bottom: -2em;
width: 100%;
height: 75px;
background: url('http://www.aaas.com/themes/assa/img/cabecera.png') repeat left center;
}
.sf-menu a {
position: relative;
top: 20px;
display:block;
margin-right:2px;
padding: 0 22px 0 20px;
line-height:35px;
border: 10;
text-decoration:none;
text-transform: uppercase;
font-family:Handlee;
font-size: 18px;
font-weight: bold;
}
.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
color: #916e6e;
white-space:nowrap;
}
.sf-menu li ul {
border:1px solid #f1b6b1; box-shadow:2px 2px 4px rgba(0,0,0,0.25);
width:500px;
padding: 0;
margin: 23px 0px 0px 0px;
top:0;
background: white;
}
.sf-menu li li {
background: white;
position: relative;
top: 0;
height:35px;
line-height:35px;
padding: 0;
margin: 0px 0px 0px 0px;
}
.sf-menu li li a {
font-size: 16px;
text-transform: capitalize;
top:0;
}
/*
ul.sf-menu li a {
padding-right: 2.25em;
min-width: 1px;
padding-top: 20px;
margin-top: -20px;
}
*/
.sf-menu li li li {
background: white;
width:140px;
}
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
font-weight: bold;
color: white;
background: url('http://www.sasa.com/themes/sasa/img/boton-b.png') no-repeat center 0px;
}
.sf-menu ul li:hover, .sf-menu ul li.sfHover,
.sf-menu ul li a:focus, .sf-menu ul li a:hover, .sf-menu ul li a:active {
background: #eecfd0; //#4e4e4e;
outline: 0;
}
/*** arrows **/
.sf-menu a.sf-with-ul {
padding-right: 2.25em;
min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
padding-top: 20px;
margin-top: -20px;
}
.sf-sub-indicator {
position: absolute;
display: block;
right: 10px;
top: 1.05em; /* IE6 only */
width: 10px;
height: 35px;
text-indent: -999em;
overflow: hidden;
background: url('../img/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: 11px;
background-position: 0 -100px; /* use translucent arrow for modern browsers*/
}
/* apply hovers to modern browsers */
a:focus > .sf-sub-indicator,
a:hover > .sf-sub-indicator,
a:active > .sf-sub-indicator,
li:hover > a > .sf-sub-indicator,
li.sfHover > a > .sf-sub-indicator {
background-position: -10px -100px; /* arrow hovers for modern browsers*/
}
/* point right for anchors in subs */
.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
/* apply hovers to modern browsers */
.sf-menu ul a:focus > .sf-sub-indicator,
.sf-menu ul a:hover > .sf-sub-indicator,
.sf-menu ul a:active > .sf-sub-indicator,
.sf-menu ul li:hover > a > .sf-sub-indicator,
.sf-menu ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px 0; /* arrow hovers for modern browsers*/
}
/*** shadows for all but IE6 ***/
.sf-shadow ul {
background: url('../img/shadow.png') no-repeat bottom right;
padding: 0 8px 9px 0;
-moz-border-bottom-left-radius: 17px;
-moz-border-top-right-radius: 17px;
-webkit-border-top-right-radius: 17px;
-webkit-border-bottom-left-radius: 17px;
}
.sf-shadow ul.sf-shadow-off {
background: transparent;
}
li.sf-search {
background: inherit;
float: right;
line-height: 25px;
background:transparent;
}
li.sf-search input {
-moz-border-radius: 0 5px 5px 0;
padding: 5px 0;
position: relative;
top: 1px;
padding-left: 30px;
margin: 18px 6px 0 0;
background: #fff url('../../../../img/search-zoom3.png') no-repeat left center;
border:1px solid #777;
}
/* hack IE7 */
.sf-menu a, .sf-menu a:visited {height:34px !IE;}
.sf-menu li li {
width:200px;
background:#726f72 !IE;
}
#block_top_menu .category-thumbnail {
display:none;
clear: both;
width: 100%;
float: none; }
#block_top_menu .category-thumbnail div {
float: left;
width: 33.33333%; }
#block_top_menu .category-thumbnail div img {
max-width: 100%; }
#block_top_menu li.category-thumbnail {
padding-right: 0; }
/* Mobile Item */
.sf-menu-phone-item { display:none; }
#sf-menu-phone-trigger { display:none; position:absolute; top:7px; right:0; background:url('http://www.sasa.com/themes/sasas/img/icon-mobile-nav.png') top right no-repeat #29addd; width:50px; height:50px; text-indent:-9999px; border-radius:3px;
-webkit-transition: all 0.5s ease 0s;
-moz-transition: all 0.5s ease 0s;
-o-transition: all 0.5s ease 0s;
transition: all 0.5s ease 0s; }
#sf-menu-phone-trigger:hover { background-color:#333; }
#sf-menu-phone-trigger.active { background-position:bottom right; }
#media only screen and (max-width: 999px) {
.sf-menu a, .sf-menu a:visited {font-size:13px;}
}
/* Tablet Only Queries */
#media only screen and (min-width: 531px) and (max-width: 786px) {
.sf-menu a, .sf-menu a:visited {font-size:12px;}
}
/* Phone Only Queries */
#media only screen and (max-width: 530px) {
.sf-menu a{
top:5px;
}
#sf-menu-header {height:auto; }
#sf-menu-top-nav {margin-left:-2%; margin-right:-2%;}
/*.sf-menu {display:none; } */
.sf-menu {width:100%; height:auto; margin:10px 0 0 0; position:static !important}
.sf-menu li {width:100%; background:#f4f4f4; border-top:1px solid #fff !important; border-bottom:1px solid #999 !important; -webkit-border-radius:0; border-radius:0; }
.sf-menu li:hover {background:#de8686;}
.sf-menu li ul {width:100%; position:static !important; background:#ccc;}
.sf-menu li li {width:100% !important; background:#ccc; }
/*.sf-menu li li li {display:none !important;}*/
.sf-menu-phone-item { display:block; }
#sf-menu-phone-trigger { display:block; }
.sf-search {padding:10px;}
#searchbox {margin-left:15px;}
#searchbox input[type="text"] {width:80%;}
#searchbox input[type="text"]:focus, #searchbox input[type="text"]:hover {width:80%;}
#searchbox .button {width:10%;}
#header_logo { padding-right:50px; text-align:left !important;}
}
Thank you very much I really appreciate your help
When the browser's width increases, there's some JavaScript running somewhere that adds display: none as inline CSS to the element. The problem is that this script only works when the browser's width is larger than 600px. To solve this problem, you'll have to apply the following css to your sub-menu:
.sf-menu li ul {
display: none;
}
.sf-menu li a:hover + ul {
display: block !important;
}
There is some modification made in javascript, and as the code is obfuscate/optimized, it will be difficult to tell what you have to correct.
Setting a CSS rule above that is a kind of rubber patch, you should first find the location in the source code where the modification occurs. May be you could append this code in your question.
There is also a problem with how your submenus are generated. The one for "novedades" is a child an ul element in the "Washi Tape" li
<ul class="sf-menu clearfix menu-content">
<li>Novedades</li>
<li>Washi Tape
<ul>
<li>Por colores
<ul>
<li>Amarillo</li>
<li>Azul</li>
<li>Gris</li>
<li>Marrón</li>
<li>Naranja</li>
<li>Negro</li>
<li>Rojo</li>
<li>Rosa</li>
<li>Verde</li>
<li>Violeta</li>
</ul>
</li>
<li>Lisos</li>
<li>Líneas</li>
<li>Topos</li>
<li>Estampados</li>
<li>Naturaleza</li>
<li>Infantil</li>
<li>Corazones</li>
<li>Estrellas</li>
<li>Con mensaje</li>
<li>Purpurina/Glitter</li>
<li class="category-thumbnail"></li>
</ul>
</li>
<li class="sf-search noBack" style="float:right">
<form id="searchbox" action="http://www.dulcewashitape.com/index.php?controller=search" method="get">
<p>
<input type="hidden" name="controller" value="search" />
<input type="hidden" value="position" name="orderby" />
<input type="hidden" value="desc" name="orderway" />
<input type="text" name="search_query" placeholder="Buscar" value="" />
</p>
</form>
</li>
</ul>
I had a quick look at the site. As I suspected display:none disappears at that point. So, its an issue with your csss. They are too complicated for me right now. A suggestion is to put display:none !important which will override other rules.
I have designed a menu.
HTML code is give
<div class="navi">
<ul class="menu">
<li class="current_page_item">Women</li>
<li>Men</li>
<li>Junior</li>
<li>Accessories</li>
<li>Collections
<ul class='children'>
<li>Year</li>
<li>2014
<ul class='children'>
<li>SUMMER</li>
<li>AUTUMN</li>
<li>WINTER</li>
<li>SPRING</li>
</ul>
</li>
<li>2013</li>
</ul>
</li>
<li>Sale</li>
<li class="last"><a href='#'>MY ACCOUNT</a>
</li>
</ul>
<br style="clear:both;" />
</div>
The CSS is give bellow
.navi {
width:1000px;
margin:0 auto;
border-bottom:5px solid #000;
height:50px;
}
.menu {
width:1000px;
margin:0 auto;
}
.menu, .menu ul {
display: block;
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
border: 0 none;
display: block;
float: left;
margin: 0;
padding: 0;
position: relative;
z-index: 5;
}
.menu li:hover {
white-space: normal;
z-index: 10000;
}
.menu li li {
float: none;
}
.menu ul {
left: 0;
position: absolute;
top: 0;
visibility: hidden;
z-index: 10;
}
.menu li:hover > ul {
top: 100%;
visibility: visible;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu:after, .menu ul:after {
clear: both;
content: ".";
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.menu, .menu ul {
min-height: 0;
}
.menu ul {
margin: -10px 0 0 -30px;
padding: 10px 30px 30px;
}
.menu ul ul {
margin: -30px 0 0 -10px;
padding: 30px 30px 30px 10px;
}
.menu ul li a:hover, .menu li li a:hover {
color: #484848;
text-decoration: none;
}
.menu ul {
min-width: 15em;
width: auto;
}
.menu a.arrow
{
background: url(arrow.gif) no-repeat right center;
}
.menu ul a.arrow
{
background: url(right.gif) no-repeat 97% center;
}
.menu .menuRight
{
float: right;
margin-right: 0px;
}
.menu a {
font-family:Harvest;
color: #314350;
display: block;
height:55px;
line-height:55px;
margin: 0 0px 0 0;
padding: 0 1em;
position: relative;
text-decoration: none;
font-size:18px;
}
.menu a:hover {
background-color: #1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu .current_page_item a {
background-color:#1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu li li {
-moz-border-bottom-colors: 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 #B2B2B2 #B2B2B2;
border-image: none;
border-right: 1px solid #B2B2B2;
border-style: none solid solid;
border-width: medium 1px 1px;
color: #444444;
filter: none;
width: auto;
}
.menu li li a {
background-position: 50% 50%;
background-repeat: no-repeat;
border: medium none;
color: #444444;
font-size: 12px;
font-weight: 400;
height: 20px;
line-height: 20px;
padding: 5px 10px;
text-shadow: none;
white-space: nowrap;
}
.menu li li a:hover {
background:#E5E4E4;
border: medium none;
color: #333;
filter: none;
}
.menu ul > li + li {
border-top: 0 none;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu > li:first-child > a {
border-left: medium none;
}
.menu > li:first-child > a, .menu li + li + li li:first-child > a {
}
.menu ul.children a, .menu .current_page_ancestor, .menu .current_page_ancestor ul a {
background: none;
filter: none;
}
.menu ul.children a{background:url(images/arrow.png) no-repeat 93% 70%;}
.menu ul.children a:hover{background:url(images/arrow.png) no-repeat 93% 70% #999;}
ul.sub-menu .current_page_item a {
background:none;
}
.footer-box-last {
width:420px;
float:left;
background:#b6c2c9;
height:150px;
}
.footer_outer {
background:url(mail-icon.png) repeat:none;
width:400px;
border-radius:5px;
margin:5px;
background-color:#fff;
}
.footer-box-last h2 {
color:#e8ecee;
font-size:20px;
font-weight:lighter;
margin:15px 15px 15px 7px;
}
.footer-box-last label {
color:#9B9B9A;
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
}
.icon {
width:20px;
height:30px;
float:left;
margin:11px 0 0 5px;
}
.field-2 {
border: medium none;
width:220px;
height:30px;
border-radius:5px;
border:none;
color:#4c565f;
margin:5px;
}
.form_btn {
background-color:#3bc0c3;
color:#ffffff;
float:right;
border-radius:5px;
height:34px;
width:120px;
border:none;
margin:4px;
}
.last {
float:right;
padding-left:60px;
font-style:italic;
}
</style>
I want to move the last li item to the left. then it will look like this n pic
I need a space between SALES and MY ACCOUNT
please help me in this.
Thank you in advance
Try adding this:
.menu li.last {
float:right;
}
You had the right CSS in your code (.last), but you need to give it more authority as it is being overwritten by #menu li code. So on your last declaration change it to ".menu li.last" instead of ".last"
Try This
.menu li.last {
float:right;
}
OR
.menu li:last-child {
float:right;
}
Try this
.menu li:last-child {
float:right;
}
Try this:
.last{
position: relative;
left: -50px;
}
I am developing a wordpress them and the homepage consists of a fixed header and footer and a vertical slider in the middle including content and images. I am building the website responsive but what I am noticing is that when the screen is resized the content in the vertical sliders is being cut off(Forget the images - just the boxes with the title and text). How can I make the main cont always start beneath the header and above the footer ?
Here is a js fiddle of what I am talking about: http://jsfiddle.net/tdWb9/
Some css:
#charset "UTF-8";
/* CSS Document */
* {
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
}
/* Style for our header texts
* --------------------------------------- */
h1{
font-size: 4em;
color: #fff;
margin:0;
padding :0;
}
html,body{
margin: 0;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.home-button {
-moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
-webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
box-shadow:inset 0px 1px 0px 0px #cae3fc;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #00baf2) );
background:-moz-linear-gradient( center top, #79bbff 5%, #00baf2 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#00baf2');
background-color:#79bbff;
-webkit-border-top-left-radius:10px;
-moz-border-radius-topleft:10px;
border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
-moz-border-radius-topright:10px;
border-top-right-radius:10px;
-webkit-border-bottom-right-radius:10px;
-moz-border-radius-bottomright:10px;
border-bottom-right-radius:10px;
-webkit-border-bottom-left-radius:10px;
-moz-border-radius-bottomleft:10px;
border-bottom-left-radius:10px;
text-indent:0;
border:1px solid #469df5;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:17px;
font-weight:bold;
font-style:normal;
height:38px;
line-height:38px;
width:128px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #287ace;
}
.home-button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #00baf2), color-stop(1, #79bbff) );
background:-moz-linear-gradient( center top, #00baf2 5%, #79bbff 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00baf2', endColorstr='#79bbff');
background-color:#00baf2;
}.home-button:active {
position:relative;
top:1px;
}
.home-button h3{
text-align:center;
}
.intro{
background-color: rgba(255, 255, 255, 0.8);
width:30%;
border-radius:10px;
padding-bottom:20px;
padding-left:3%;
padding-right:3%;
margin-left:10%;
}
.intro2{
background-color:white;
width:30%;
border-radius:10px;
opacity:0.8;
filter:alpha(opacity=80);
padding-bottom:20px;
margin-right:10%;
float:right;
}
.intro h1, .intro2 h1{
color:black;
padding-top:3%;
}
.intro p, .intro2 p{
color: black;
}
/* Centered texts in each section
* --------------------------------------- */
.section{
text-align:left;
}
/* Backgrounds will cover all the section
* --------------------------------------- */
#section0,
#section1,
#section2,
#section3{
background-size: cover;
}
/* Defining each sectino background and styles
* --------------------------------------- */
#section0{
background-image: url(images/image1.jpg);
}
#section2{
background-image: url(images/image2.jpg);
}
#section3{
background-image: url(images/image3.jpg);
}
/* Overwriting styles for control arrows for slides
* --------------------------------------- */
.controlArrow.prev {
left: 50px;
}
.controlArrow.next{
right: 50px;
}
/* Fixed header and footer.
* --------------------------------------- */
#header, #footer{
display:block;
width: 100%;
background: #05556d;
text-align:center;
color: #f2f2f2;
}
#footer{
padding:10px 0px;
font-size:12px;
}
.home #header, .home #footer{
position:fixed;
z-index:9;
}
.home #header{
top:0px;
}
.home #footer{
bottom:0px;
}
#footer a{
color:#00baf2;
}
#footer-other{
z-index:9999;
width: 100%;
background: #05556d;
text-align:center;
color: #f2f2f2;
}
#footer-other{
padding:10px 0px;
font-size:12px;
}
#footer-other a{
color:#00baf2;
}
/* Bottom menu
* --------------------------------------- */
#infoMenu {
bottom: 80px;
}
#infoMenu li a {
color: #fff;
z-index: 999;
}
*Main Menu CSS*/
#import url(http://fonts.googleapis.com/css?family=Oxygen+Mono);
#cssmenu {padding: 0; margin: 0; border: 0;}
#cssmenu ul, #cssmenu li {list-style: none; margin: 0; padding: 0;}
#cssmenu ul {position: relative; z-index: 597; }
#cssmenu ul li { float: left; min-height: 1px; vertical-align: middle;}
#cssmenu ul li.hover,
#cssmenu ul li:hover {position: relative; z-index: 599; cursor: default;}
#cssmenu ul ul {visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598;}
#cssmenu ul ul li {float: none;}
#cssmenu ul ul ul {top: 0; left: auto; right: -99.5%; }
#cssmenu ul li:hover > ul { visibility: visible;}
#cssmenu ul ul {bottom: 0; left: 0;}
#cssmenu ul ul {margin-top: 0; }
#cssmenu ul ul li {font-weight: normal;}
#cssmenu a { display: block; line-height: 1em; text-decoration: none; }
#cssmenu {
background: #05556d;
border-bottom: 4px solid #00baf2;
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
font-size: 16px;
}
#cssmenu > ul { *display: inline-block; }
#cssmenu:after, #cssmenu ul:after {
content: '';
display: block;
clear: both;
}
#cssmenu a {
background: #05556d;
color: #CBCBCB;
padding: 0 20px;
}
#cssmenu ul { text-transform: uppercase; }
#cssmenu ul ul {
border-top: 4px solid #1b9bff;
text-transform: none;
min-width: 190px;
}
#cssmenu ul ul a {
background: #1b9bff;
color: #FFF;
border: 1px solid #0082e7;
border-top: 0 none;
line-height: 150%;
padding: 16px 20px;
}
#cssmenu ul ul ul { border-top: 0 none; }
#cssmenu ul ul li { position: relative }
#cssmenu > ul > li > a { line-height: 80px; }
#cssmenu ul ul li:first-child > a { border-top: 1px solid #0082e7; }
#cssmenu ul ul li:hover > a { background: #00baf2; }
#cssmenu ul ul li:last-child > a {
border-radius: 0 0 3px 3px;
box-shadow: 0 1px 0 #1b9bff;
}
#cssmenu ul ul li:last-child:hover > a { border-radius: 0 0 0 3px; }
#cssmenu ul ul li.has-sub > a:after {
content: '+';
position: absolute;
top: 50%;
right: 15px;
margin-top: -8px;
}
#cssmenu ul li:hover > a, #cssmenu ul li.current-menu-item > a {
background: #00baf2;
color: #FFF;
}
#cssmenu ul li.has-sub > a:after {
content: '+';
margin-left: 5px;
}
#down{display:none}
#cssmenu ul li.last ul {
left: auto;
right: 0;
}
#cssmenu ul li.last ul ul {
left: auto;
right: 99.5%;
}
.logo{
margin-top:5px;
float:left;
margin-left:20%;
padding-right:10px;
position:relative;
z-index:10000;
}
#Media screen and (max-width:480px) {
.intro{
width:70%;
margin-top:20%;
}
.intro h1, .intro2 h1{
color:black;
padding-top:3%;
}
.intro p, .intro2 p{
color: black;
}
.main-container{
width:85% !important;
}
#sbs{position: absolute;
width: 20px;
padding: 8px;
cursor:pointer;
height: 20px;
border: 0px solid white;
border-radius: 5px;
top: 5px;
left: 10px;}
.sb{width: 100%;
height: 4px;
display: inline-block;
border-bottom: 2px solid white;
float: left;
clear: both;}
#down{cursor:pointer;display:table;width:350px; margin:0 auto; margin-bottom:10px; text-align:center;padding: 15px 0px; background: #00baf2; color: white;margin-top: 10px;position:relative;}
#cssmenu *:not{ float :left !important; width: 100%;padding-left: 0px !important; padding-right: 0px !important;}
#cssmenu {
width: 87%;
display: table;
margin: 0 auto;
}
#down + #cssmenu { display: none;}
#down.open + #cssmenu { display: block;}
.logo{margin:0;padding:0;width: 100%;text-align: center;margin-bottom:10px;}
#cssmenu .logo > a{margin:0;padding:0}
#cssmenu ul li { display: block ; width: 100% ; text-align:center; }
#cssmenu > ul > li > a { line-height: 50px; }
#cssmenu ul ul {
border-top: 4px solid #1b9bff;
text-transform: none;
width: 100%;
/* float: left; */
}
#cssmenu ul ul ul {display:none;}
#cssmenu .has-sub:hover > ul {
border-top: 0 none;
visibility:visible;
display: block;
float: left;
clear: both;
position:relative;
right: 0;
}
#cssmenu ul li.hover, #cssmenu ul li:hover{
display:inline-block;
}
.content1{font-size:100%;}
}
}
#Media screen and (max-width:768px) {
.logo{ margin-left:10%;}
}
.login{
background-color:#00baf2;
width:5%;
margin-right:10%;
margin-top:-60px;;
float:right;
padding:10px 10px 10px 10px;
}
.main-container{
width:60%;
height:100%;
margin-left:auto;
margin-right:auto;
padding-top:3%;
}
.imgsection{
float:left;
padding-right:5%;
}
.main-container img{
max-width:100% !important;
height:auto;
display:block;
}
It's hard to tell because the text wont feet all in the page because it's a slider, so when you pull down to see more text it will change to the next slider,
The best way that I find better and simpliest to do it is by adding this css code:
p {font-size:82%}
Or if you want to keep the font-size to 100% you can do it by adding this css code which makes the div scroll:
.section{
height:55%;
overflow-y: scroll;
overflow-x: hidden;
}
.intro{
height:55%;
overflow-y: scroll;
overflow-x: hidden;
}
I think the scroll will work fine as you drag the mobile mouse into the text area without conflict with changing to the next slide, but I can't tell for sure because I'm not testing it on a mobile, but you can do the test.
Or... in a last resort, you could create a smaller logo and put it on the left side of the menu and compact the header size.
Regards
The images of list items in dropdown menu repeats three times even though "no repeat" is added in html. please help me.
html code.
<div class="menu">
<ul>
<li style='background-image:url(images/menu2s.jpg)0 0 no-repeat;'><a></a>
<ul>
<li style='background-image:url(images/sets.jpg)0 0 no-repeat;'>Settings</li>
<li style='background-image:url(images/more-icon.png)0 0 no-repeat;'>More</li>
</ul>
</li>
</ul>
</div>
css file
body{padding: 3em; }
.menu * {
padding:0;
margin: 0;
font: 12px georgia;
list-style-type:none;}
.menu {
position: absolute;
bottom:0px;
float: left;
line-height: 10px;
left: 100px;
z-index: 50;}
.menu a {
display: block;
text-decoration: none;
color: #3B5330;}
.menu a:hover { background: #B0BD97;}
.menu ul li ul li a:hover {
background: #ECF1E7;
padding-left:9px;
border-left: solid 1px #000;}
.menu ul li ul li {
width: 140px;
border: none;
color: #B0BD97;
padding-top: 3px;
padding-bottom:3px;
padding-left: 3px;
padding-right: 3px;
background: #B0BD97;
z-index:50;
}
.menu ul li ul li a {
font: 22px arial;
font-weight:normal;
font-variant: small-caps;
padding-top:3px;
padding-bottom:3px;
z-index:50;}
.menu ul li {
float: left;
width: 146px;
font-weight: bold;
border-top: solid 1px #283923;
border-bottom: solid 1px #283923;
background: #979E71;
z-index:50;}
.menu ul li a {
font-weight: bold;
padding: 15px 10px;
z-index:50;}
.menu li{
position:relative;
float:left;
z-index:50;}
.menu ul li ul, #menu:hover ul li ul, #menu:hover ul li:hover ul li ul{
display:none;
list-style-type:none;
width: 140px;
z-index:50;}
.menu:hover ul, #menu:hover ul li:hover ul, #menu:hover ul li:hover ul li:hover ul {
display:block;
z-index:50;}
.menu:hover ul li:hover ul li:hover ul {
position: absolute;
margin-left: 145px;
margin-top: -22px;
font: 10px;
z-index:50;}
.menu:hover ul li:hover ul {
position: absolute;
margin-top: 1px;
font: 10px;
z-index:50;
}
.menu>ul>li:hover>ul {
bottom:100%;
border-bottom: 1px solid transparent
z-index:50;
}
Write it like this. You wrote shorthand in background-image rather than Background.
style='background:url(images/sets.jpg) 0 0 no-repeat;
> or
style='background:url(images/sets.jpg) no-repeat 0 0 ;
You have not given space between the brace and zero.