Line break in my Navigation bar in Chrome but not Firefox - html

Here is the page in questions: http://www.jacobsievers.com/sample.html
In Firefox and IE, My navigation bar displays correctly, but if you look at it with Chrome there is a line break after 'Gallery'. I'm wondering if someone can help me figure out what I need to do or change in my code. Something with the nav ul or nav li in my css?
(source: jacobsievers.com)
(source: jacobsievers.com)
I don't know how to make those scroll box things that other people put code in so here are some jpgs sorry! Thanks for the help.

nav ul {
text-align: center;
width: 700px;
margin: auto;
word-spacing: 50px;
padding: 0;
font-size: 20px;
}
Should fix it :)
EDIT:
/************************ =Nav ************************/
nav ul {
text-align: center;
width: 700px;
margin: auto;
padding: 0;
font-size: 20px;
}
nav li {
display: inline;
margin: auto;
position: relative;
top:30px;
margin-left: 100px;
}
nav li:first-child { margin-left: 0px; }
nav a {
text-decoration: none;
color: rgb(50, 140, 204);
transition: background-color 2s;
-moz-transition: background-color 2s;
/* Firefox 4 */
-webkit-transition: background-color 2s;
/* Safari and Chrome */
-o-transition: background-color 2s;
/* Opera */
transition: color 2s;
-moz-transition: color 2s;
/* Firefox 4 */
-webkit-transition: color 2s;
/* Safari and Chrome */
-o-transition: color 2s;
/* Opera */
}
nav a:hover {
background-color: #E0EEEE;
color: black;
}
jsFiddle - http://jsfiddle.net/andyjh07/cqZTV/

Related

How to add a image zoom effect with a text overlay using css

I am trying to get an effect using css which I keep getting 90% right but each time I try something different, it results in another problem elsewhere.
What I am trying to do:
Have the image zoom on mouseover
Have the text remain in place and not zoom
Problem:
The hover works fine EXCEPT when the mouse goes over the text-overlay (because the effect is on img:hover. I effectively want the text-overlay to be visible to the eyes BUT transparent to the mouse-over
Here is my fiddle: https://jsfiddle.net/knrrrfxo/
I have tried making the image a background image but that creates a whole other list of issues with responsive sizing which also wont work.
Code:
<style>
.tile-wrapper {
margin:0;
padding:0;
overflow: hidden;
position: relative;
}
.new-arrivals-link {
line-height: 0;
}
.new-arrivals-link img {
-webkit-transition: all 1s ease; /* Safari and Chrome */
-moz-transition: all 1s ease; /* Firefox */
-ms-transition: all 1s ease; /* IE 9 */
-o-transition: all 1s ease; /* Opera */
transition: all 1s ease;
}
.new-arrivals-link img:hover {
-webkit-transform:scale(1.25); /* Safari and Chrome */
-moz-transform:scale(1.25); /* Firefox */
-ms-transform:scale(1.25); /* IE 9 */
-o-transform:scale(1.25); /* Opera */
transform:scale(1.25);
}
.new-arrivals-link img:hover {
opacity: 0.8;
}
.tile-wrapper .text-overlay {
position: absolute;
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
text-align: center;
}
.tile-wrapper .text-overlay h2 {
color: white;
font-size: 60px;
line-height: 74px;
margin: 0 0 10px;
}
.tile-wrapper .text-overlay p {
color: white;
font-size: 28px;
}
</style>
<div class="tile-wrapper">
<a href="#" itemprop="url" class="new-arrivals-link">
<img src="https://cdn.shopify.com/s/files/1/1307/5753/files/new-arrivals-tab.jpg?6713767595666642894" width="100%" alt="New Arrivals">
<div class="text-overlay">
<h2>NEW<br>ARRIVALS</h2>
<p>Shop Now</p>
</div>
</a>
</div>
You can set pointer-events: none; on the .text-overlay div.
All you need is change a single selector to apply to hover of the parent instead of the image element, like so (the changed line is indicated by a comment):
.tile-wrapper {
margin:0;
padding:0;
overflow: hidden;
position: relative;
}
.new-arrivals-link {
line-height: 0;
}
.new-arrivals-link img {
-webkit-transition: all 1s ease; /* Safari and Chrome */
-moz-transition: all 1s ease; /* Firefox */
-ms-transition: all 1s ease; /* IE 9 */
-o-transition: all 1s ease; /* Opera */
transition: all 1s ease;
}
.new-arrivals-link:hover img { /* this line has been changed */
-webkit-transform:scale(1.25); /* Safari and Chrome */
-moz-transform:scale(1.25); /* Firefox */
-ms-transform:scale(1.25); /* IE 9 */
-o-transform:scale(1.25); /* Opera */
transform:scale(1.25);
}
.new-arrivals-link img:hover {
opacity: 0.8;
}
.tile-wrapper .text-overlay {
position: absolute;
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
text-align: center;
}
.tile-wrapper .text-overlay h2 {
color: white;
font-size: 60px;
line-height: 74px;
margin: 0 0 10px;
}
.tile-wrapper .text-overlay p {
color: white;
font-size: 28px;
}
<div class="tile-wrapper">
<a href="#" itemprop="url" class="new-arrivals-link">
<img src="https://cdn.shopify.com/s/files/1/1307/5753/files/new-arrivals-tab.jpg?6713767595666642894" width="100%" alt="New Arrivals">
<div class="text-overlay">
<h2>NEW<br>ARRIVALS</h2>
<p>Shop Now</p>
</div>
</a>
</div>
This works because it applies when the parent element of both the image and the text box is hovered over, which is also true if you hover over any of it's child elements.

hover issue in opera , chrome

Hello i am having an issue with chrome and safari (firefox seems to work fine) i have this html:
<div>
<a target="_blank" class="newsletter" href="#"><i class="fa fa-newspaper-o"></i></a>
</div>
CSS:
.newsletter i{
height:35px;
width:35px;
color:#FFFFFF;
font-size: 18px;
background-color: #00495e;
border-radius: 100%;
border:1px solid #FFFFFF;
padding:7px;
transition: all 0.5s;
-moz-transition: all 0.5s; /* Firefox 4 */
-webkit-transition: all 0.5s; /* Safari and Chrome */
-o-transition: all 0.5s; /* Opera */
}
.newsletter i:hover{
color:#00495e;
background-color: #FFFFFF;
}
i am not able to hover inside all circle, the place of icon doesnt work. I mean, when i pass mouse over icon inside circle doesnt do the hover effect and doesnt appear the click icon.
Here it is:
.newsletter i {
display:block;
text-align: center;
line-height:35px;
height: 35px;
width: 35px;
color: #FFFFFF;
font-size: 18px;
background-color: #00495e;
border-radius: 100%;
border: 1px solid #FFFFFF;
padding: 7px;
transition: all 0.5s;
-moz-transition: all 0.5s;
/* Firefox 4 */
-webkit-transition: all 0.5s;
/* Safari and Chrome */
-o-transition: all 0.5s;
/* Opera */
}
.newsletter {
text-decoration: none;
}
.newsletter:hover i {
color: #00495e;
background-color: #FFFFFF;
}
https://jsfiddle.net/Lnats6fj/

Switching menu to a tab picture when screen is too small

So right now I have a working setup so that when the nav is bigger than the screen then a picture slider down works out. However, the problem is that the nav does not minisize soon enough as it goes over the logo. I want it to be more sensitive to take the logo size into account as well.
Right now this is how I'm achieving this.
HERE IS THE https://jsfiddle.net/q2ozq1q2/3/
/* primary navigation
--------------------------------------------------------------------- */
#nav-wrap ul, #nav-wrap li, #nav-wrap a {
margin: 0;
padding: 0;
border: none;
outline: none;
}
/* nav-wrap */
#nav-wrap {
position: relative;
font: 22px raleway-bold, sans-serif;
float: right;
margin-top: 36px;
margin-right: 20px;
z-index: 99999;
}
/* hide toggle button */
#nav-wrap > a.mobile-btn {
display: none;
border-radius: 3px;
}
ul#nav {
min-height: 48px;
width: auto;
/* left align the menu */
text-align: left;
}
ul#nav li {
position: relative;
list-style: none;
height: 48px;
display: inline-block;
}
/* Links */
ul#nav li a {
/* 8px padding top + 8px padding bottom + 32px line-height = 48px */
display: inline-block;
padding: 8px 11px;
line-height: 32px;
text-decoration: none;
text-align: left;
color: #14C9CF;
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
ul#nav li a:active { background-color: transparent !important; }
ul#nav li:hover > a,
ul#nav li.current a { color: #fff; }
/* adds down arrow */
ul#nav span:after {
width: 0;
height: 0px;
border: 4px solid transparent;
border-bottom: none;
border-top-color: #8a8383;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: 5px;
}
/* Sub Menu
----------------------------------------------------- */
ul#nav ul {
position: absolute;
top: 100%;
left: 0;
background: #1f2024;
min-width: 100%;
border-radius: 0 0 3px 3px;
/* for transition effects */
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
/* Third level sub menu
ul#nav ul ul {
position: absolute;
top: 0;
left: 100%;
border-radius: 0 3px 3px 3px;
}
*/
ul#nav ul li {
padding: 0;
display: block;
text-align: left;
/* for transition effects */
height: 0;
overflow: hidden;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
}
/*On Hover */
ul#nav li:hover > ul { opacity: 1; filter: alpha(opacity=100); }
ul#nav li:hover > ul li {
height: 42px;
overflow: visible;
border-bottom: 1px solid #26272C;
}
ul#nav li:hover > ul li:last-child { border: none; }
/* Sub Menu Anchor links */
ul#nav ul li a {
padding: 6px 15px;
margin: 0;
white-space: nowrap;
font-size: 13px;
}
You can see that it achieves it by this:
/* hide toggle button */
#nav-wrap > a.mobile-btn {
display: none;
border-radius: 3px;
}
But it does not use the the logo to know exactly when it starts or stops. So the nav will overlay onto the logo. Is there a way to account for the logo?
EDIT
https://jsfiddle.net/q2ozq1q2/3/
If I understand you correctly, you can change the width on the media-query to around 990px like so: (on line 289 in the fiddle)
#media only screen and (max-width: 990px) {
Hey u can resize both image and navigation bar when viewed on smaller screen :
Use following css as example:
img {
max-width:250px;
max-height:250px;
}
#nav-wrap ul#nav {
position:absolute;
width:100%;
}
ul#nav ul li a{
word-break:break-all;
width:100%;
}
You should add a class for img tag -
header .logo a {
display: block;
margin: 0;
padding: 0;
border: none;
outline: none;
}
header .logo a img{
width: 210px;
height: 34px;
}

Vertical aligning text

I'm trying to vertically align some text in a div whilst the text is under an image.
I'm not very good at explaining things but this is the code I have so far: https://jsfiddle.net/c1249bd8/
HTML:
<div class="childContainer">
<a href="#" class="childLink">
<img src="http://placekitten.com/g/500/500" alt="Test" class="childImg"/>
<h1 class="childName">Testing</h1>
</a>
</div>
CSS:
.childContainer {
/* Height and width */
height: 10rem;
width: 10rem;
/* Hide overflow */
overflow: hidden;
/* Allows z-index */
position: relative;
/* Circle */
border-radius: 50%;
}
.childLink {
/* No default link styling */
color: #000;
text-decoration: none;
/* All Bubble is link */
height: 100%;
width: 100%;
/* Circle */
border-radius: 50%;
}
.childImg {
/* Full Bubble */
height: 100%;
width: 100%;
/* On top of text */
z-index: 1;
position: absolute;
/* Fade in/out stuff */
opacity: 1;
transition: opacity .30s ease-in-out;
-moz-transition: opacity .30s ease-in-out;
-webkit-transition: opacity .30s ease-in-out;
}
.childNameWrapper {
vertical-align: middle;
display: table-cell;
}
#import url('http://fonts.googleapis.com/css?family=Roboto:400,300|Luckiest+Guy');
.childName {
/* Behind Image */
position: absolute;
z-index: 0;
/* In Center */
text-align: center;
/* Nice handwriting font */
font-family: 'Luckiest Guy', cursive;
}
.childImg:hover {
/* Fade on hover */
opacity: 0;
transition: opacity .30s ease-in-out;
-moz-transition: opacity .30s ease-in-out;
-webkit-transition: opacity .30s ease-in-out;
}
Thanks,
Oscar.
Use display flex. It is quite easy and simple to use.
Check the FIDDLE.
.childLink {
display:flex;
align-items : center;
/* No default link styling */
color: #000;
position:relative;
text-decoration: none;
/* All Bubble is link */
height: 100%;
width: 100%;
/* Circle */
border-radius: 50%;
// vertical-align:middle;
}
change your 'childname' class to this:
.childName {
/* Behind Image */
position: relative;
z-index: 0;
line-height: 90px;
/* In Center */
text-align: center;
/* Nice handwriting font */
font-family: 'Luckiest Guy', cursive;
The trick here is the lineheight :)

Menu Hover is not working in IE

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