I downloaded this MENU from dynamicdrive.com but there is someone wrong in it.
It works fine in FireFox , Safari and Chrome. But not working in IE.
In IE 9 or lower, it appears vertical menu not horizontal and hover is not working also.
CSS
<style>
.spotlightmenu{
width: 100%;
overflow:hidden;
}
.spotlightmenu ul{
margin: 0;
padding: 0;
font: bold 14px Verdana;
list-style-type: none;
text-align: center;
background: #e3e3e3;
}
.spotlightmenu li{
display: inline-block;
position:relative;
padding: 5px;
margin: 0;
margin-right: 5px;
}
.spotlightmenu li a{
display:inline-block;
padding: 5px;
min-width:50px;
height:50px;
text-decoration: none;
color: black;
margin: 0 auto;
overflow:hidden;
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.spotlightmenu li:hover a{
color: white;
background: #a71b15;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.spotlightmenu li a span{
position:relative;
top:35%;
}
</style>
HTML
<div class="spotlightmenu">
<ul>
<li><span>Home</span></li>
<li><span>About us</span></li>
<li><span>Products</span></li>
<li><span>Contact us</span></li>
</ul>
</div>
If you are testing in IE-9 or lower the transitions will not work. It is currently working in IE-10. Hope this helps.
Your CSS is using the transition timing function. This is not supported in IE 9 or below. The bar is horizontal in all the browsers I tested. If you're using something < IE 9, you should look to get a new computer
Related
I have a css price box with shows two buttons on the bottom of the box.
But those buttons looks like they are one.
<div class="pricefooter">
<div class="button">
Boek nu
Info
</div>
</div>
for the style I have this
.button{
width:50%;
height:50px;
margin:30px 10px;
padding-left: 30 px;
padding-right: 30 px;
background:#ff9547;
text-align:center;
cursor:pointer;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.button:hover{
width:60%;
}
.button a{
color:#fff;
font-size:14px;
font-weight:bold;
text-decoration:none;
margin:10px 10px;
padding-left: 30 px;
padding-right: 30 px;
line-height:3;
}
I'm kind of stuck here. I want two separate buttons on bottom of the table. Here is the full example example price table wellness
Do you want the button to be totally separate, with their own animation too?
If so you probably want to do something like this:
.button a {
background: #ff9547;
color: #fff;
font-size: 14px;
font-weight: bold;
text-decoration: none;
margin: 2px;
border: 1px solid #dd7325;
padding: 15px 30px 15px 30px;
line-height: 3;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.button a:hover {
padding: 15px 50px 15px 50px;
}
<div class="pricefooter">
<div class="button">
Really long text example
Book now!
Info
</div>
</div>
Remove the background-color from div and add it to the anchor .button a.
Also add display: inline-block; to the .button a.
.button {
width: 50%;
height: 50px;
margin: 30px 10px;
padding-left: 30 px;
padding-right: 30 px;
text-align: center;
cursor: pointer;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.button:hover {
width: 60%;
}
.button a {
color: #fff;
font-size: 14px;
font-weight: bold;
text-decoration: none;
margin: 10px 10px;
padding-left: 30px;
padding-right: 30px;
line-height: 3;
background: #ff9547;
display: inline-block;
}
<div class="pricefooter">
<div class="button">
Boek nu
Info
</div>
</div>
simplify and clean your code:
you have 2 buttons right? why put 2 links in the same button?, I think it's not a best practice.
button is a html tag so style it instead crate other class:
http://www.w3schools.com/tags/tag_button.asp
all above looks right but I think this one looks more clean and organized
html:
<div class="pricefooter">
<button type="button" class='btn'>Click Me! </button>
<button type="button" class='btn'>Click Me! </button>
</div>
css:
button{
height:50px;
padding: 0 30px 0 30px;
background:#ff9547;
text-align:center;
cursor:pointer;
border: 0;
}
.btn a:hover{
padding: 15px 50px 15px 50px;
}
.btn a{
color:#fff;
font-size:14px;
font-weight:bold;
text-decoration:none;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
jsfiddle: https://jsfiddle.net/9e4j8xrn/2/
Hello As I can see you apply background and width css on button class you should be change it into the .button a
updating css:
.button {
cursor: pointer;
height: 50px;
margin: 30px 10px;
text-align: center;
}
.button a:hover {
padding: 10px 25px;
}
.button a {
background: #ff9547 none repeat scroll 0 0;
color: #fff;
font-size: 14px;
font-weight: bold;
line-height: 3;
margin: 10px;
padding: 8px 20px;
text-decoration: none;
transition: all 0.4s ease-in-out 0s;
}
I'm working in Dot Net Nuke on a website that has been previously setup. I want to add a css button I found on the internet. I put the html in the html fields and css in the stylesheet editor.
when a link is created it automatically adds ">>" after the link text. In other buttons css buttons I used I managed to remove that, but with this button I can't remove it. Also I want the button to link to another page using "a href". How would i make this possible?
Button HTML:
<div class="btn-container">
<input type="submit" value="button" id="button-blue"/>
<div class="ease"></div>
</div>
Button CSS:
#button-blue {
float: left;
width: 100%;
max-width: 500px;
border: white solid 4px;
cursor: pointer;
background-color: #0493bd;
margin-top: -4px;
color: white;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
letter-spacing: .1em;
padding-top: 22px;
padding-bottom: 22px;
font-weight: 500;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-ms-transition: all 0.3s;
transition: all 0.3s;
}
/* Change text color & background opacity on hover*/
#button-blue:hover {
background-color: rgba(0,0,0,0);
color: #0493bd;
}
/* The white hover effect */
.ease {
width: 0px;
height: 70px;
background-color: white;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
/* Make visable when hover */
.btn-container:hover .ease {
width: 100%;
max-width: 500px;
background-color: white;
border: 0;
}
.btn-container:after {
display: none !important;
}
well you want the button to link to another page, to do that you can simply style your href to look as a button like this (Run the following snippet) -
Submit
<style>
#submit-btn{
display :inline-block;
text-decoration:none;
background-color:blue;
border-radius:4px;
padding:5px 10px;
color:white;
}
</style>
Well for the issue of >> after every link it may be some css that is adding it, which you haven't posted in your question so try adding following code which may remove it..
a:after {
content: none !important;
}
OR this one -
a:after {
display: none !important;
}
or just for the link like button I posted above try this -
#submit-btn:after {
content: none !important;
}
OR
#submit-btn:after {
display: none !important;
}
NOTE - Since you are overwriting CSS don't forget to add !important..
Change to button to href
<div class="btn-container">
Button
<div class="ease"></div>
</div>
CSS
#button-blue{
float:left;
width: 100%;
max-width:500px;
border: white solid 4px;
cursor: pointer;
background-color: #0493bd;
margin-top: -4px;
color: white;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
letter-spacing: .1em;
padding-top: 22px;
padding-bottom: 22px;
font-weight: 500;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-ms-transition: all 0.3s;
transition: all 0.3s;
text-align:center;
}
/* Change text color & background opacity on hover*/
#button-blue:hover{
background-color: rgba(0,0,0,0);
color: #0493bd;
}
#button-blue:after{content:">>"}
/* The white hover effect */
.ease {
width: 0px;
height: 70px;
background-color: white;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
/* Make visable when hover */
.btn-container:hover .ease{
width: 100%;
max-width: 500px;
background-color: white;
border: 0;
}
.btn-container:after {
display: none !important;
}
demo link
https://jsfiddle.net/0zctLenb/
I'm trying to set up a hover header for my site, but having a lot of trouble getting it to do what I want. I have individual smaller divs to display staff members and when hovered over I want it to give a slide effect, preferably to the left.
Ok, I created a fiddle here http://jsfiddle.net/2badzt19/
HTML:
<div class="staffinfo">
<a class="first-link" href="">
<img src=http://i57.tinypic.com/23tsj0i.jpg>
</a>
<a href="">
Admin Info
</a>
</div>
CSS:
.staffinfo a{
color: white;
text-decoration:none;
text-align: center;
display:block;/* important */
}
.staffinfo, .first-link{
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-ms-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
}
.staffinfo{
height: 100px;
font: normal normal 700 1em/4em Arial,sans-serif;
overflow: hidden;
width: 120px;
background-color: #3b5998;
}
.staffinfo:hover{
background-color: #003D99;
}
.staffinfo a:hover{
text-decoration: none;
}
.first-link{
margin-top: 0em;
}
.staffinfo:hover .first-link{
margin-top: -7em;
}
How would I make it slide left? And how can I display it as a table of 6 images the same size, 2 columns, 3 rows?
Heres how I'd do it, no table but a list:
HTML
<ul class="slider">
<li>Admin Info</li>
<li>User Info</li>
<li>Something</li>
<li>Something Else</li>
<li>What?</li>
<li>More</li>
</ul>
CSS
ul.slider
{
width:280px;
list-style:none;
padding:0;
}
ul.slider>li {
height: 100px;
font: normal normal 700 1em/4em Arial, sans-serif;
overflow: hidden;
width: 120px;
background-color: #3b5998;
background-image:url("http://i57.tinypic.com/23tsj0i.jpg");
position:relative;
display:inline-block;
}
ul.slider>li>a {
display:block;
margin-left:120px;
width: 120px;
height:100px;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-ms-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
color:#FFF;
text-align:center;
line-height:100px;
}
ul.slider>li:hover>a {
margin-left:0px;
background-color: #003D99;
}
Basically, the a is offset to the right via a margin the same with of the li. This margin is removed on hover of the li
Example
Now with sexy transparent background
Or if you want inline images
I currently have this JSfiddle.
HTML:
<div class="refTable">
<div class="refRow">
<div class="refCell"><img src="images/test.jpg" /><p>Test 1</p></div>
<div class="refSep"></div>
<div class="refCell"><img src="images/test.jpg" /><p>Test 2</p></div>
<div class="refSep"></div>
<div class="refCell"><img src="images/test.jpg" /><p>Test 3</p></div>
</div>
</div>
CSS:
.refTable {
display:table;
max-width:919px;
width:100%;
margin:0px auto;
}
.refRow {
display:table-row;
}
.refCell {
display:table-cell;
width:291px;
text-align: center;
font-size:16px;
border:1px #ffffff solid;
padding:0px 0px 10px 0px;
background:#eaeaea;
color:#333333;
-webkit-border-radius: 20px 20px 20px 20px;
border-radius: 20px 20px 20px 20px;
resize: none;
outline:0;
transition-duration: 0.2s;
}
.refCell img {
-webkit-border-radius: 20px 20px 0px 0px;
border-radius: 20px 20px 0px 0px;
padding-bottom:5px;
}
.refCell p {
line-height: 20px;
}
.refCell:hover {
border-color:#b32f01;
background:#ffffff;
-webkit-transition: color background 0.2s ease-in-out;
-moz-transition: color background 0.2s ease-in-out;
-ms-transition: color background -0.8s ease-in-out;
-o-transition: color background 0.2s ease-in-out;
transition: color background 0.2s ease-in-out;
cursor:pointer;
color:#cacaca;
}
.refCell:hover img {
opacity:0.4;
-webkit-transition: opacity 0.2s ease-in-out;
-moz-transition: opacity 0.2s ease-in-out;
-ms-transition: opacity -0.8s ease-in-out;
-o-transition: opacity 0.2s ease-in-out;
transition: opacity 0.2s ease-in-out;
}
.refSep {
display:table-cell;
width:20px;
}
In the fiddle, no images display in the boxes. However, there normally would be. On hover, the boxes change background color, font color, and, provided there is an image, image opacity. That's fine.
Now, I would like to make it so that, on hover, an image or div "slides" up from the bottom/side/top that says "Visit this website", possibly with some sort of icon.
What is the best approach? I've really been thinking about it, but I can't come up with a solution.
I did this with just css :hover and css3 transitions.
This is the css I wrote,
.info {
position: absolute;
top: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
-webkit-transition: top 0.6s ease-in-out;
left: 0;
color: #f7f7f7;
text-decoration: none;
}
.refCell:hover .info {
top: 0;
display: block;
}
I also added this to the .refCell class,
position: relative;
overflow: hidden;
The html I added,
<span class="info">Click to view website</span>
Here is the JSFIDDLE to see how it works.
Live fiddle:
http://jsfiddle.net/jMAzr/1/
Working example at Apple.com:
http://www.apple.com/
<html>
<head>
<style>
body {
background:#000000;
}
li {
list-style:none;
display: list-item;
}
ul.menu li {
float:left;
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
text-decoration: none;
font-weight: 400;
}
ul.menu li a {
text-decoration:none;
}
.header-tab-title {
display: block;
position: relative;
height: 46px;
line-height: 46px;
cursor: pointer;
font-size: 16px;
color: #fff;
text-align: center;
}
.search-field {
width: 70px;
border-radius:10px;
transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-webkit-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-moz-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-o-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
animation-direction:reverse;
-webkit-animation-direction:reverse; /* Safari and Chrome */
border: 1px solid #353535;
height:18px;
padding: 0px 23px 4px;
color:#FFF;
}
.search-field:focus {
color:#000;
width: 140px;
margin-left:-70px;
height:20px;
}
</style>
</head>
<body>
<ul class="menu">
<li><span class="header-tab-title" style="width:124px;">Produtos</span></li>
<li><span class="header-tab-title" style="width:151px;">Sites Prontos</span></li>
<li><span class="header-tab-title"style="width:192px;" >Anuncie no Google</span></li>
<li><span class="header-tab-title" style="width:230px;">Facebook Para Negócios</span></li>
<li><span class="header-tab-title" style="width:152px;">Hospedagem</span></li>
<li><span class="header-tab-title" style="width:110px;"><input class="search-field" type="search"></span></li>
</ul>
</body>
</html>
The behaviour you are looking for requires a table layout to change the width of the other "cells" as one grows. I have created a simplified fiddle with this layout:
http://jsfiddle.net/Hp3JU/
I've removed a couple of elements to simplify the example but the essence of the solution is to have an outer display: table, then a display:table-row then each "cell" is display:table-cell. Give the "table" a fixed width and remove the negative margin on the :hover psuedo-class to prevent the last cell overlapping its neighbor. You'll also need to remove your hardcoded fixed widths so your cells can collapse as required to make room.
<div class="table">
<ul class="menu">
<li>Produtos</li>
<li>Sites Prontos</li>
<li>Anuncie no Google</li>
<li>Facebook Para Negócios</li>
<li>Hospedagem</li>
<li><input class="search-field" type="search" /></li>
</ul>
</div>
CSS (Relevant parts only):
.table {
display: table;
width: 100%;
}
ul.menu {
display: table-row;
}
ul.menu > li {
display: table-cell;
}
.search-field {
width: 70px;
border-radius:10px;
transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-webkit-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-moz-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
-o-transition: width 0.5s ease-in-out,margin-left 0.5s ease-in-out;
animation-direction:reverse;
-webkit-animation-direction:reverse; /* Safari and Chrome */
border: 1px solid #353535;
height:18px;
padding: 0px 23px 4px;
color:#FFF;
}
.search-field:focus {
color:#000;
width: 140px;
height:20px;
}
Apple does it by adding a class to the nav element when the user focuses the search field.
Default State:
Active State:
Thus, to mimic the same functionality you're going to need JavaScript to add a class to the ul.menu element. This class will change the width of the menu. Use CSS animations to control the sliding effect.