css configuration for map template - css

Hi I'm using a bootstrap template to display some map tools but I been having problems with css of the div containing the map-canvas when I collapse the side panel the map moves to the proper place but live blank space on the opposite side and also there is a big issue with the height of the map.
I'm looking to place the map to full extend when sidepanel is collapsed or extended tried everything without success, I will appreciate any help from the stackoverflow community.
Thanks in advance.
here is a link to my page https://secure.cevamhn.net/AirAid/maptoolsair.php
css code here:
/*!
* Start Bootstrap - Simple Sidebar HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/* Toggle Styles */
#wrapper {
padding-left: 0px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 0px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0; /* disini agar ketika di kecilkan tidak hilang semua default 0*/
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 0px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -150px;
}
/*------------------------------------------------ MAP FEATURES BEGIN ----------------------------------*/
#map-canvas {
height: 100%;
width: 100%;
margin-left: 0px;
padding: 0px;
}
#drawPanel {
position: absolute;
width: 200px;
font-family: Arial, sans-serif;
font-size: 13px;
float: left;
margin-top: 5px;
margin-left: 200px;
z-index: 1000;
}
#color-palette {
clear: both;
}
.color-button {
width: 20px;
height: 20px;
font-size: 0;
margin: 2px;
float: left;
cursor: pointer;
}
#delete-button {
margin-top: 0px;
margin-left: 22px;
}
#wrapper.toggled #map-canvas #drawPanel #color-palette.color-button #delete-button {
position: absolute;
}
#botLeft{
color: red;
font-weight: bold;
border: 0px solid;
background-color: transparent;
}
#botRight{
color: red;
font-weight: bold;
border: 0px solid;
background-color: transparent;
}
input {
color: White;
font-weight: bold;
border: 0px solid;
background-color: transparent;
text-align: left;
}
#opacity {
color: black;
font-weight: bold;
background-color: white;
width: 30px;
height: 20px;
margin-left: 5px;
}
/*------------------------------------------------ END MAP FEATURES ----------------------------------*/
.fixed-brand{
width: auto;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
margin-top: 2px;
}
.sidebar-nav li {
text-indent: 15px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255,255,255,0.2);
border-left: red 2px solid;
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
.no-margin{
margin:0;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
.fixed-brand{
width: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#wrapper.toggled-2 #sidebar-wrapper {
width: 50px;
}
#wrapper.toggled-2 #sidebar-wrapper:hover {
width: 250px;
}
#page-content-wrapper {
padding: 0px;
position: relative;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#map-canvas {
padding: 442px; /* ------------------------------- If left at 0 Map is not Display ---------------------- */
position: relative;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
padding-left: 200px;
}
#wrapper.toggled #map-canvas #map-canvas {
position: relative;
margin-right: 0px;
padding-left: 0px;
}
#wrapper.toggled-2 #page-content-wrapper {
position: relative;
margin-right: 0px;
margin-left: -220px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled-2 #map-canvas #map-canvas #drawPanel #color-palette.color-button #delete-button {
position: relative;
margin-right: 0px;
margin-left: 0px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
}

When ever the size of the div containing your map changes, you need to trigger the 'resize' event on your Map object.
google.maps.event.trigger(map, 'resize');
Also, by changing:
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 0px;
}
to:
#page-content-wrapper {
min-width: 100%;
position: absolute;
padding: 0px;
}
the element stays the width of the space.

Related

Vertical ul li navigation with bigger centered dropdown

I thought it would have been simple, I'm trying to make a small navigation with numbers which show a name below on hover which should be like this :
But I don't know how to keep it centered and without having big margins between numbers. Here is a JSFiddle
.dropdown {
font-size: 10pt;
width: 10px;
}
nav ul {
font-size: 0;
list-style: none;
margin: 0;
padding: 0;
text-align: center;
width: 100%;
}
nav li {
display: inline-block;
margin: 0;
padding: 0;
position: relative;
width: auto;
}
nav a {
color: #444;
display: block;
padding: 0 25px;
text-align: center;
text-decoration: none;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
nav li ul {
font-size: 10pt;
height: 20px;
left: 0;
opacity: 0;
position: absolute;
top: 35px;
visibility: hidden;
z-index: 1;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
nav li:hover ul {
opacity: 1;
top: 50px;
visibility: visible;
}
nav li ul li {
width: 100%;
}
nav li ul a {
background: #bbb;
}
Here the result thanks to #Ovakuro : JSFiddle
Here is a solution to your layout using flexbox. I've simplified your CSS quite a bit, let me know if you have any questions.
nav .cf,
.dropdown {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
}
nav .cf li {
position: relative;
}
nav .cf li a {
color: #444;
padding: 0 10px;
text-decoration: none;
}
nav .cf li:hover .dropdown {
opacity: 1;
visibility: visible;
}
/* style your dropdown menu here */
.dropdown {
width: 100%;
list-style: none;
font-size: 10pt;
position: absolute;
top: 30px;
opacity: 0;
visibility: hidden;
z-index: 1;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
.dropdown li {
display: flex;
}
nav .cf .dropdown li a {
padding: 10px 20px;
background: #bbb;
text-align: center;
white-space: nowrap;
}
/* triangle */
.dropdown:after {
bottom: 100%;
content: " ";
position: absolute;
border: solid transparent;
border-bottom-color: #bbb;
border-width: 10px;
}
<nav>
<ul class="cf">
<li>
01
<ul class="dropdown">
<li>E-CAMPUS</li>
</ul>
</li>
<li>
02
<ul class="dropdown">
<li>PEGASEZBUZZ</li>
</ul>
</li>
</ul>
</nav>
To my knowledge, the only way to do this is to set a width to the ul children so you can center it after. It's necessary if you need to go beyond parents' width.
I use transform translate, but if you need to be fully backward compatible, you would do this in js. Also, you may have problems with screen sides this way, again, js is your friend.
Note : I added /* new */ in css so you can see what I did. ;) Cheers
.dropdown {
font-size: 10pt;
width: 10px;
}
nav ul {
font-size: 0;
list-style: none;
margin: 0;
padding: 0;
text-align: center;
width: 100%;
position: relative; /* new */
}
nav li {
display: inline-block;
margin: 0;
padding: 0;
position: relative;
width: auto;
}
nav a {
color: #444;
display: block;
padding: 1em;
text-align: center;
text-decoration: none;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
nav li ul {
font-size: 10pt;
height: 20px;
left: 0;
opacity: 0;
position: absolute;
top: 35px;
visibility: hidden;
z-index: 1;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
left: 50%; /* new */
transform: translateX(-50%); /* new */
width: 200px; /* new */
}
nav li:hover ul {
opacity: 1;
top: 50px;
visibility: visible;
}
nav li ul li {
width: 100%;
}
nav li ul a {
background: #bbb;
}
<nav>
<ul class="cf">
<li><a class="dropdown" href="#">01</a>
<ul>
<li>E-CAMPUS</li>
</ul>
</li>
<li><a class="dropdown" href="#">02</a>
<ul>
<li>PEGASEZBUZZ</li>
</ul>
</li>
</ul>
</nav>
Is this close to what you wanted?
body {
background-color: black;
}
.dropdown {
font-size: 20pt;
width: 10px;
}
nav ul {
font-size: 0;
list-style: none;
margin: 0;
padding: 0;
text-align: center;
width: 100%;
}
nav li {
display: inline-block;
margin: 0;
padding: 0;
position: relative;
width: auto;
}
nav a {
color: gray;
display: block;
padding: 0 25px;
text-align: center;
text-decoration: none;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
nav li ul {
font-size: 10pt;
height: 20px;
left: 0;
opacity: 0;
position: absolute;
top: 35px;
visibility: hidden;
z-index: 1;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
nav li:hover ul {
opacity: 1;
top: 50px;
visibility: visible;
margin-top: -10px;
}
nav li ul li {
width: 100%;
}
nav li:hover ul:before {
content: "";
position: absolute;
bottom: -10px;
border-style: solid;
border-color: #EDEDED transparent;
display: block;
top: -8px;
bottom: auto;
right: 15px;
border-width: 0 10px 10px;
}
nav li ul a {
background: #EDEDED;
width: 100px;
margin-left: -25px;
margin-bottom: 100px;
padding: 10px;
color: #0050F7;
}
.dropdown:hover {
color: white;
}
<nav>
<ul class="cf">
<li><a class="dropdown" href="#">01</a>
<ul>
<li>E-CAMPUS</li>
</ul>
</li>
<li><a class="dropdown" href="#">02</a>
<ul>
<li>PEGASEZBUZZ</li>
</ul>
</li>
</ul>
</nav>
Or if you want your hover tags always centered you may use this:
body {
margin: 0;
padding: 0;
}
.container {
background-color: black;
width: 500px;
height: 300px;
}
ul {
list-style: none;
color: #666;
font-size: 30px;
margin: 0;
padding: 0;
text-align: center;
padding-top: 20px;
position:relative;
}
ul li {
display: inline-block;
padding: 0 12px;
}
.hover {
position:absolute;
top:70px;
text-align:center;
width:100%;
left:0;
display:none;
}
.hover span {
display: inline-block;
background-color:#fff;
color:blue;
font-size:30px;
padding:12px 20px;
}
li:hover {color:#bbb;}
li:hover .hover {display:block;}
.hover:before {
content:"";
display:inline-block;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #fff;
padding:0;
position:absolute;
top:-5px;
}
.hv1:before {left:154px;}
.hv2:before {left:214px;}
.hv3:before {left:278px;}
.hv4:before {left:340px;}
<div class="container">
<ul>
<li>01
<div class="hover hv1"><span>This is the first 1</span></div>
</li>
<li>02
<div class="hover hv2"><span>Tag2 here</span></div>
</li>
<li>03
<div class="hover hv3 "><span>Tag3 much much longer</span></div>
</li>
<li>04
<div class="hover hv4 "><span>Tag4</span></div>
</li>
</ul>
</div>
Notice you need a text covering enough room for the arrow to show

horizontal scrollbar showing even when overflow is hidden

I'm running into a problem in my website, where an horizontal scrollbar is always showing even when i add overflow-x: hidden to the body, html elements. Instead of hiding the scrollbar, another scrollbar is added vertically and now i have two vertical scrollbars!
This happened because i have a centered navigation and add to set a child div of that same navigation, to 100% of the viewport width. Checked the developer tools in chrome and that div is going some pixels to the right.
Anyway, since overflow didn't work, i tried to change the values of the calc() function to subtract those pixels but the horizontal scrollbar is still there.
Here is my code:
<div id="container">
<ul class="nav">
<li>home</li>
<li>
destinations
<div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
<div class="nav-column">
</div>
</div>
</li>
<li>about</li>
<li>contact</li>
</ul>
</div>
And the css:
body,html {
background-color: white;
border: 0;
outline: 0;
margin: 0;
padding: 0;
max-width: 100%;
overflow-x: hidden;
}
#container {
display: block;
margin: 0 auto;
text-align: center;
position: relative;
width: 100%;
}
.nav {
cursor: default;
display: inline-block;
height: 125px;
position: relative;
top: 50px;
width: auto;
-ms-flex-pack: center;
-ms-display: -ms-flexbox;
}
.nav,
.nav a,
.nav ul,
.nav li,
.nav div {
border: none;
padding: 0;
margin: 0;
outline: none;
}
.nav a {
text-decoration: none;
}
.nav li {
list-style: none;
}
.nav > li {
display: block;
float: left;
}
.nav > li > a {
display: block;
color: black;
font-family: 'Oswald', sans-serif;
font-size: 1.2em;
font-weight: 500;
text-transform: uppercase;
height: 30px;
padding: 0 20px;
position: relative;
z-index: 510;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-ms-transition: all .3s ease;
transition: all .3s ease;
}
.nav li:hover a {
background: black;
color: white;
}
.nav > li > div {
border: 1px solid black;
display: inline-block;
color: black;
position: absolute;
top: 30px;
left: calc(-50vw + 50%);
width: 100vw;
opacity: 0;
overflow: hidden;
visibility: hidden;
background: white;
z-index: 500;
-webkit-transition: all .3s ease .5s;
-moz-transition: all .3s ease .5s;
-o-transition: all .3s ease .5s;
-ms-transition: all .3s ease .5s;
transition: all .3s ease .5s;
}
.nav li:hover > div {
opacity: .7;
visibility: visible ;
overflow: hidden;
}
.nav .nav-column {
background-color: white;
float: left;
text-align: left;
top: -30px;
padding: 2%;
position: relative;
width: 15%;
}
.nav .nav-column h3 {
color: #d1a559;
font-family: Orator Std, IrisUPC, sans-serif;
font-weight: 900;
margin: 20px 0 10px 0;
text-decoration: underline ;
}
.nav .nav-column li {
padding-left: 0;
font-family: Palatino linotype, Rockwell;
}
.nav .nav-column li a {
background: white;
color: black;
display: block;
}
.nav .nav-column li a:hover {
background: #d1a559;
color: white;
-webkit-transition: all .1s ease;
-moz-transition: all .1s ease;
-o-transition: all .1s ease;
-ms-transition: all .1s ease;
transition: all .1s ease;
}
#media (max-width:1420px) {
.Thumbnails {
float: none;
}
}
#media (max-width: 950px) {
.nav li:hover > div {
background-color: white;
opacity: 1;
}
.nav .nav-column {
position: relative;
width: 20%;
}
.nav .nav-column li {
list-style: none;
}
}
#media (max-width: 700px) {
.nav li:hover > div {
background-color: white;
left: 0;
opacity: 1;
width: 100%;
}
.nav .nav-column {
float: none;
}
}
.colAbout {
display: block;
float: none;
}
.span_1_of_3 {
width: 70%;
}
#media (max-width: 530px) {
.nav {
display: none;
text-align: left;
height: 150px;
top: 0;
padding: 0;
margin: 0;
position: relative;
z-index: 999;
}
.nav li {
float: none;
left: 0;
}
.nav li:hover > div {
opacity: 1;
top: 113px;
}
.nav > li > a {
border-right: none;
display: block;
left: 0;
}
/*Div contendo responsive button*/
#menu {
border: 1px solid black;
color: black;
cursor: pointer;
display: block;
font-size: 1.3em;
left: 0;
margin: 5%;
position: relative;
text-align: center;
z-index: 540;
width: 1.4em;
}
#container {
left: 0;
display: block;
padding: 0;
position: relative;
width: 100%;
}
ul {
width: 100%;
list-style: none;
}
}
#media (min-width: 530px) {
#menu {
display: none;
}
}
And a fiddle example
If you just want to hide the scrollbar:
#container {
overflow: hidden!important;
}
I encountered the same issue. I still don't know the root cause, but setting overflow to "-moz-hidden-unscrollable" seems to hide the scrollbar.
.container {
overflow: -moz-hidden-unscrollable
}
I have checked your CSS. To prevent the scrollbar from being displayed, you should comment out two CSS properties: position: relative; top: 34px;
.nav {
cursor: default;
display: inline-block;
height: 125px;
width: auto;
-ms-flex-pack: center;
-ms-display: -ms-flexbox;
}

How can I create a searchbar like this?

I really like the search bar on this website, https://www.marmosetmusic.com/
I can do it very basically using CSS steps animation but it doesn't look smooth and I have to change the timing based on the length of the placeholder.
Also, I am not sure how to overlay it as such over an image or parallax design.
What I have tried is:
HTML:
<title>Search</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />
<link rel="stylesheet" href="css/type-style.css" media="screen" type="text/css" />
<script src="js/modernizr.js"></script>
</head>
<body>
<h1>
<i class='fa fa-anchor'></i>
Test.com
</h1>
<div class='overlay'></div>
<div class='wrapper'>
<form class='search'>
<input placeholder="search..." required='true' type='text'>
<button class='search-button'>
<i class='fa fa-search'></i>
</button>
</form>
</div>
<script src="js/index.js"></script>
</body>
</html>
CSS:
#import url(http://fonts.googleapis.com/css?family=Alegreya+Sans+SC:300,400);
body {
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/16902/holidayphoto.jpg);
background-position: 0 90%;
overflow: hidden;
}
body, html {
height: 100%;
}
h1 {
color: #fff;
font-size: 3.5em;
text-align: center;
font-family: 'Alegreya Sans SC', sans-serif;
padding: 20px;
font-weight: 300;
opacity: 1;
}
h1 i {
color: #e74c3c;
}
.overlay {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
background: #000;
opacity: 0.92;
top: 0;
left: 0;
}
.wrapper {
width: 560px;
height: 60px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -280px;
margin-top: -20px;
-webkit-font-smoothing: antialiased;
z-index: 999999;
}
input[type="text"] {
font-family: 'Alegreya Sans SC', sans-serif;
width: 480px;
height: 40px;
padding: 10px 0 10px 20px;
font-size: 24px;
font-weight: 300;
color: #eee;
background: #222;
border: none;
float: left;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
input:focus {
color: #fff;
outline: none;
background: #1a1a1a;
}
button[type="submit"], .search-button {
border: 0;
width: 60px;
height: 60px;
background: #222222;
border-left: solid 5px #222222;
text-align: center;
float: left;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
button[type="submit"] i, .search-button i {
color: #fff;
font-size: 40px;
line-height: 1.4em;
}
.search-button:focus {
outline: none;
}
.search-button:hover {
background: #e53f2e;
border-left: #e53f2e;
}
.switch-wrapper {
font-family: 'Alegreya Sans SC', sans-serif;
width: 70px;
height: 40px;
margin: 10px;
border-radius: 40px;
position: absolute;
background: #444;
right: 118px;
cursor: pointer;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
.switch-wrapper:before {
position: absolute;
content: 'FLIGHT';
line-height: 2.7em;
left: -54px;
}
.switch-wrapper:after {
position: absolute;
content: '+ HOTEL';
line-height: 2.7em;
right: -60px;
}
.switch-wrapper .switch {
width: 36px;
height: 36px;
margin: 2px 2px;
background: #222;
border-radius: 50%;
position: absolute;
}
.switch-wrapper .switch:hover {
background: #282828;
}
.rent {
position: absolute;
left: 30px;
}
.switch-wrapper.switched:after {
color: #3498db;
text-shadow: 0 0 4px #3498db;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
.switch-wrapper.switched:before {
color: #cfcfcf;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
.switch-wrapper.not-switched:after {
color: #cfcfcf;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
.switch-wrapper.not-switched:before {
color: #3498db;
-webkit-transition: all 420ms ease-in-out;
-moz-transition: all 420ms ease-in-out;
-o-transition: all 420ms ease-in-out;
transition: all 420ms ease-in-out;
}
.not-valid {
display: none;
width: 100%;
height: 30px;
background: #e74c3c;
position: absolute;
opacity: 1;
top: 70px;
}
.not-valid span {
font-family: 'Alegreya Sans SC', sans-serif;
color: #fff;
padding: 10px;
line-height: 1.96em;
}
.not-valid span i {
padding-right: 4px;
}
.not-valid span .error-close {
color: #7b190f;
float: right;
padding: 7px 10px 0 0;
cursor: pointer;
}
label.error {
display: none !important;
}
JS
var s = $('.switch');
var sw = $('.switch-wrapper');
$('input').on('click', function(a) {
a.preventDefault();
});
function switchToggle() {
s.stop(false,true).animate({left: "0"}, 200);
}
s.on('click', function() {
if (sw.hasClass('switched')) {
switchToggle();
} else if (sw.hasClass('not-switched')) {
s.stop(false,true).animate({left: "30px"}, 200);
}
sw.toggleClass('switched not-switched');
});
$('.search').validate({
invalidHandler: function(event, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
$("div.not-valid span").html("<i class='fa fa-warning'></i> Please type search <i class='fa fa-times error-close'></i>");
// Should use .stop() function.
$(".not-valid").fadeIn();
setTimeout(function() {
$(".not-valid").fadeOut();
}, 2000);
$('.error-close').on('click', function() {
$(".not-valid").fadeOut();
});
} else {
$(".not-valid").fadeOut();
}
}
});
All in one is found in this jsfiddle demo.
Any help would be appreciated!
Here is a simple example of how to style a search field in a similar manner as seen in your example. display: flex does most of the magic here, the rest is getting rid of backgrounds and borders or styling the submit button with an image
For the typing animation you should use a premade plugin like typed.js
.search {
background: rgba(0, 0, 0, 0.1);
display: flex;
}
.search input {
border: 0px;
margin: 0px;
padding: 0px;
}
.search input[type="text"] {
flex: 1;
background: transparent;
font-size: 2em;
}
.search input[type="submit"] {
font-size: 2em;
margin: 4px;
width: 1em;
height: 1em;
cursor: pointer;
background-color: transparent;
background-image: url(https://cdn0.iconfinder.com/data/icons/basic-lines/39/search-512.png);
background-size: cover;
}
.search input:focus {
outline: none;
}
<div class="search">
<input type="text" name="search">
<input type="submit" value="">
</div>

Evolve wordpress theme, sizing the header

I am using a premium wordpress theme for a quick website I'm making. Almost everything can be set in the admin panel, which is great, but the header size is not one of them and I find it to be a bit large now. I'd like to use the 'custom css' section in the admin panel because I'm not interested in creating a whole child theme for just that one line of code.
I tried searching for the right class, something is making this thing so big, but what?
This is the url to the page I'm talking about;
http://lindenmobileappstore.nl/drsachs/
This is all the css regarding the header (that I could find at least);
/* 3.2. Header and subheader
==================================== */
#dp-head-wrap {background:transparent; position:relative;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
z-index:400;
}
.page-template-template-contact-php #dp-head-wrap.semi-transparent {
background-color: rgba(33, 51, 68, 0.9)!important;}
#dp-head {
position: relative;padding: 0 10px;
}
#dp-head:after {
clear: both;
content: "";
display: table;
}
#dp-head h1 {
float: left;
margin: 0;
}
#dp-head a.cssLogo {
background: transparent url('../images/logo.png') no-repeat 0 0;
display: block;
height: 42px;
width: 143px;
text-indent: -9999px;
margin: 30px 15px 10px 0;
background-size:cover;
}
#dp-head a.textLogo {
color: #5F8CB4;
display: block;
font-size: 18px;
line-height: 22px;
padding: 7px 0 0 10px;
}
#dp-head a.textLogo small {
color: #333;
display: block;
font-size: 12px;
line-height: 12px;
}
#dp-head a.imageLogo {
display: block;
width: 160px;
height:42px;
margin: 30px 15px 10px 0;
}
#dp-head a.imageLogo img {
display: block;
width: auto;
height: auto;
max-height: 100%;
height : 100%\9; /*hack: fixes ie8 logo*/
}
.dp-header-wrapper {
background-color: #232D37;
padding: 0;
color:#fff;
position:relative;
}
#dp-header {padding: 20px 0}
#dp-header .box {margin-bottom:0}
#dp-button-area {
float: right;
margin-left: 30px;
}
#dp-button-area a {
display: block;
float: right;
margin: 42px 0 0 0;
-webkit-transition: background-color .3s ease-out;
-moz-transition: background-color .3s ease-out;
-ms-transition: background-color .3s ease-out;
transition: background-color .3s ease-out;
width:25px;
height:25px;
text-align:center;
vertical-align:middle;
color: #2d3e52;
}
#dp-header-search, #dp-logout, #dp-login {
color: #2d3e52;
font-size:18px;
display:block;
line-height:18px;
}
#dp-header-search:hover, #dp-login:hover, #dp-logout:hover {color:#5F8CB4;}
#dp-header-search-form {width:100%;
height:100%;
position:absolute;
top:0;
display:none;
background:#ffffff;
z-index:1000;}
#dp-header-search-form .dp-page {padding:50px 10px 0 10px}
#dp-header-search-form #s {
width:95%;
border:none;line-height:36pxpx;
font-size: 36px;
height:50px!important;
font-weight: 300;
color: #b9bec3;
letter-spacing: 0px;
float:left;
padding:7px 0;
background:transparent;
}
#cancel-search {float:right; width:40px; height:40px;
cursor:pointer;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;color:#b9bec3 }
#cancel-search i {font-size:40px; text-align: center;line-height:40px;}
#cancel-search:hover {
transform:rotate(360deg);
-ms-transform:rotate(360deg);
-webkit-transform:rotate(360deg);
}
.dp-subheader-wraper {
background: #213344;
padding: 0;
}
.dp-subheader {position:relative; height:120px;}
.dp-subheader .main-title {margin:0; padding:25px 0 0 10px; font-size:36px;font-weight:100;line-height:40px}
.dp-subheader .sub-title {margin:0; padding:0 0 0 10px; font-size:13px; font-weight:400; opacity:0.7;}
.dp-subheader .dp-breadcrumbs {position:absolute;right:15px;top:45px;font-size:13px;}
.dp-subheader .dp-breadcrumbs a, .dp-subheader .dp-breadcrumbs span {opacity:0.7}
.dp-subheader .dp-breadcrumbs a:hover {opacity:1}
.sf-menu li {
height: 100px;
}
Remove menu item height and overall height will be based on logo image.

Any guidance on float overs?

I found this tabbed content and so far set it up but for the life of me cannot figure out how to change the colour of the tab to a difference colour when you hover over it.
I thought it would be the tabs label:hover but it doesn't seem to be.
My code is here:
body, html {
height: 100%;
margin: 0;
-webkit-font-smoothing: antialiased;
font-weight: 100;
background: #ffffff;
text-align: center;
font-family: helvetica;
}
.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 670px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 20px;
border-radius: 0px 0px 0 0;
color: #ffffff;
font-size: 18px;
font-weight: normal;
font-family: helvetica;
background: #f3f3f3;
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: #9eab05);
top: 1px;
}
/* LABEL COLOURS */
[id^=tab]:checked + label {
background: #e3ba12;
color: white;
top: 0;
}
[id^=tabfindme]:checked + label {
background: #e3ba12;
color: white;
top: 0;
}
[id^=tabtwitter]:checked + label {
background: #0085a1;
color: white;
top: 0;
}
[id^=tabtv]:checked + label {
background: #6a2150;
color: white;
top: 0;
}
[id^=tabteach]:checked + label {
background: #d10373;
color: white;
top: 0;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
/* CONTENT COLOURS */
.findmecontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #e3ba12;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s; }
.twittercontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #0085a1;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
.tvcontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #6a2150;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
.teachcontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #d10373;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
<ul class="tabs">
<li>
<input type="radio" checked name="tabs" id="tabfindme">
<label for="tabfindme">FIND ME</label>
<div id="tab-content1" class="findmecontent animated fadeIn">
You can find me at the following venues:
<ul>
<li>BBC Television Centre</li>
<li>OutBurst Festival</li>
</ul>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tabtwitter">
<label for="tabtwitter">TWITTER</label>
<div id="tab-content2" class="twittercontent animated fadeIn">
Twitterfeed
</div>
</li>
<li>
<input type="radio" name="tabs" id="tabtv">
<label for="tabtv">TELEVISION</label>
<div id="tab-content3" class="tvcontent animated fadeIn">
Click the links to see me on TV
<ul>
<li>BBC Television Centre</li>
<li>ITV</li>
</ul>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tabteach">
<label for="tabteach">HOW I TEACH</label>
<div id="tab-content4" class="teachcontent animated fadeIn">
How I teach
</div>
</li>
</li>
.tabs label:hover {
background: #9eab05;
top: 1px;
}
there is a ")" <-- remove it
fiddle
http://jsfiddle.net/n5ura/
body, html {
height: 100%;
margin: 0;
-webkit-font-smoothing: antialiased;
font-weight: 100;
background: #ffffff;
text-align: center;
font-family: helvetica;
}
.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
width: 670px;
float: none;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
}
.tabs li{
float: left;
}
.tabs label {
display: block;
padding: 10px 20px;
border-radius: 0px 0px 0 0;
color: #ffffff;
font-size: 18px;
font-weight: normal;
font-family: helvetica;
background: #f3f3f3;
cursor: pointer;
position: relative;
top: 3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs label:hover {
background: #9eab05;
top: 1px;
}
/* LABEL COLOURS */
[id^=tab]:checked + label {
background: #e3ba12;
color: white;
top: 0;
}
[id^=tabfindme]:checked + label {
background: #e3ba12;
color: white;
top: 0;
}
[id^=tabtwitter]:checked + label {
background: #0085a1;
color: white;
top: 0;
}
[id^=tabtv]:checked + label {
background: #6a2150;
color: white;
top: 0;
}
[id^=tabteach]:checked + label {
background: #d10373;
color: white;
top: 0;
}
[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}
/* CONTENT COLOURS */
.findmecontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #e3ba12;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s; }
.twittercontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #0085a1;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
.tvcontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #6a2150;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
.teachcontent{
z-index: 2;
display: none;
text-align: left;
width: 100%;
font-size: 12px;
line-height: 140%;
padding-top: 0px;
background: #d10373;
padding: 15px;
color: white;
position: absolute;
top: 40px;
left: 0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}
maybe change this ?
.tabs label:hover {
background: #9eab05;
top: 1px;
}
into :
.tabs label:hover {
background: #9eab05;
color:#000;
top: 1px;
}
if you want to change the color of the text. Or else change background into something else.
Use hover instead checked, example on the find me button
[id^=tabfindme]:hover + label {
background: red
color: white;
top: 0;
}

Resources