I recently added some css to my website, it works perfectly fine in all browsers except IE 7 and lower, I'm not really sure why and I am not css guru (yet ;)) and my css might be wrong, but could you please explain what makes IE7 and lower mess up the appearance of the website? If you compare it in IE8 or any other browser and IE7 you'll see what I'm talking about. Can you point where the issues are?
webpage: http://inelmo.com/inelmo
CSS of the sidebar: (I only included this, because problems started once I added this part of the code)
#sidebar {
width: 440px;
float: right;
}
/* Navigation Menu */
#navigationMenu {
width: 50px;
position: absolute;
z-index: 99;
}
#navigationMenu li {
list-style: none;
height: 39px;
padding: 2px;
width: 40px;
}
#navigationMenu span {
width: 0;
left: 38px;
padding: 0;
position: absolute;
overflow: hidden;
font-size: 18px;
font-weight: bold;
letter-spacing: 0.6px;
white-space: nowrap;
line-height: 39px;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
-ms-transition: 0.25s;
transition: 0.25s;
}
#navigationMenu a {
background: url("../images/nav_bg.png") no-repeat;
height: 39px;
width: 38px;
display: block;
position: relative;
text-decoration: none;
}
#navigationMenu a:hover span {
width: auto;
padding: 0 20px;
overflow: visible;
}
#navigationMenu a:hover {
text-decoration: none;
}
/* Home Button */
#navigationMenu .home {
background-position: 0 0;
}
#navigationMenu .home:hover {
background-position: 0 -39px;
}
#navigationMenu .home span {
background-color: #7da315;
color: #3d4f0c;
text-shadow: 1px 1px 0 #99bf31;
}
/* Categories Button */
#navigationMenu .categories {
background-position: -38px 0;
}
#navigationMenu .categories:hover {
background-position: -38px -39px;
}
#navigationMenu .categories span {
background-color: #1e8bb4;
color: #223a44;
text-shadow: 1px 1px 0 #44a8d0;
}
/* Top Button */
#navigationMenu .top {
background-position: -76px 0;
}
#navigationMenu .top:hover {
background-position: -76px -39px;
}
#navigationMenu .top span {
background-color: #c86c1f;
color: #5a3517;
text-shadow: 1px 1px 0 #d28344;
}
/* AntiTop Button */
#navigationMenu .antiTop {
background-position: -114px 0;
}
#navigationMenu .antiTop:hover {
background-position: -114px -39px;
}
#navigationMenu .antiTop span {
background-color: #af1e83;
color: #460f35;
text-shadow: 1px 1px 0 #d244a6;
}
/* Logo styling */
#logo {
width: 390px;
margin: 0 0 0 50px;
position: absolute;
z-index: -1;
}
/******/
#sideWrapper {
width: 437px;
background: url("../images/sidebar_strip.png") repeat-x;
padding: 15px 0 0 3px;
margin: 190px 0 0 0;
}
When using float:xxx you should also append display: inline to fix older IE behavior.
In IE6 :hover works only with <a>, fix: http://peterned.home.xs4all.nl/csshover.html
You seem to use position: absolute; without actually setting top/left/etc.
Use some kind of 'pngfix' like http://www.twinhelix.com/css/iepngfix/ to use transparent pngs.
Use google and sites like http://haslayout.net/ to find fun ie bugs.
Use a CSS reset
Add this code to the top of your CSS
Without an example of your code the best thing I could suggest to someone starting out is to comment out the above CSS line by line until you locate the exact CSS that breaks your layout. Another trick I use is to add background colors to everything so you can visually see where things are breaking.
Related
I'm creating a mobile nav and I have drop down menu on the charactors tab, with a back button on top made of simply a list item with text. With the back button though width 100% doesn't seem to be working I have check the dev tools and its seems like its should be working, I need it to be acting like the rest of the list items and its seem be be acting like its an inline element why?
the back a button only appears on widths 400px or less
https://jsfiddle.net/6e62ge46/11/
header nav{
position: fixed;
bottom: 0;
width: 100%;
z-index: 1;
// background-color: rgba(255,165,0,.8);
}
nav ul {
list-style: none;
padding: 0;
}
.main-nav{
margin: 0;
width: 100%;
color: white;
font-family: arial;
font-weight: 600;
}
nav ul li{
text-align: center;
border: 1px solid white;
border-radius: 15px;
font-size: 1.2rem;
background-color:rgba(255,165,0,.8);
width: 100%;
}
.drop-menu-back{
display: none;
width: 100%;
}
a{
text-decoration: none;
}
nav a:visited, nav a,h1{
color: white;
}
.main-nav .current-page {
background-color: rgba(0,0,0,.5);
}
/****drop down menu****/
.characters:hover {
position: relative;
border-radius: 8px 8px 0 0;
}
.drop-menu{
position: absolute;
visibility: hidden;
display: block;
top: 38px;
white-space: nowrap;
left: -2px;
background-color: rgba(255,165,0,.8);
border: 1px solid rgba(0,0,0,.02);
box-shadow: 5px 5px 5px 2px rgba(0,0,0,.3);
opacity: 0;
transition: opacity 300ms ease-in-out 0s;
z-index: 1;
}
.characters:hover .drop-menu{
visibility: visible;
opacity:1;
}
#media screen and (max-width: 400px) {
.drop-menu{
top:-50px;
width: 100%;
}
.drop-menu-back{
display: initial;
width: 100%;
}
}
I add a ":after" element to all links (simulate a "border-bottom") so on ":hover" i can animate this pseudo element ("height: 100%"). This works fine, but when the link is split with a line-break the pseudo element is broken after the line break.
a {
color: red;
position: relative;
text-decoration: none;
&:after {
transition: height .1s;
background-color: red;
bottom: -3px;
content: '';
display: inline;
height: 3px;
left: 0;
right: 0;
position: absolute;
width: 100%;
z-index: -1;
}
&:hover:after {
height: calc(100% + 4px);
}
&:hover {
color: white;
}
}
Here is a pen:
http://codepen.io/herrfischer/pen/YWKmQJ
Any idea what I am doing wrong?
For an inline element, background will be more efficient: http://codepen.io/gc-nomade/pen/pbzMYP
a {
color: red;
position: relative;
text-decoration: none;
background:linear-gradient(red,red) bottom repeat-x;
background-size:3px 3px;
transition:1s;
&:hover {
background-size:100% 100%;
color: white;
}
}
Stolen from another site - it works with animated background gradient :)
a {
background-image: linear-gradient(red 0%, red 100%);
background-position: bottom;
background-repeat: repeat-x;
background-size: 0 0;
border-bottom: 3px solid red;
color: red;
position: relative;
text-decoration: none;
transition: 150ms ease;
&:hover {
color: white;
background-size: 1em 1.5em;
}
}
Updated the pen.
My website Direction(attribute in body) is RTL.
When i'm trying to implement the FlexSlider it's causing the div to be blank.
Like this -
Blanck div
But if im just removing the RTL attribute from the body it's arrange perfectly like this:
arrange fine
The question is how can i bypass it? I just cant figure it out.. i tried change the Flex css but still no good..
this is the css :
/*
* jQuery FlexSlider v2.2.0
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (#mbmufffin)
*/
/* Browser Resets
*********************************/
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}
/* Icon Fonts
*********************************/
/* Font-face Icons */
#font-face {
font-family: 'flexslider-icon';
src:url('fonts/flexslider-icon.eot');
src:url('fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'),
url('fonts/flexslider-icon.woff') format('woff'),
url('fonts/flexslider-icon.ttf') format('truetype'),
url('fonts/flexslider-icon.svg#flexslider-icon') format('svg');
font-weight: normal;
font-style: normal;
}
/* FlexSlider Necessary Styles
*********************************/
.flexslider {margin: 0; padding: 0;}
.flexslider .slides > li {display: none; -webkit-backface-visibility: hidden; text-align:right;direction:rtl;} /* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img {max-width: 232px;
height: 118px;
margin: 0 auto;
display: block;
border-radius: 5px;
margin-bottom: 5px;}
.flex-pauseplay span {text-transform: capitalize;}
/* Clearfix for the .slides element */
.slides:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
html[xmlns] .slides {display: block;}
* html .slides {height: 1%;}
/* No JavaScript Fallback */
/* If you are not using another script, such as Modernizr, make sure you
* include js that eliminates this class on page load */
.no-js .slides > li:first-child {display: block;}
/* FlexSlider Default Theme
*********************************/
.flexslider { margin: 0 0 60px; background: #fff; border: 4px solid #fff; position: relative; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.2); -moz-box-shadow: 0 1px 4px rgba(0,0,0,.2); -o-box-shadow: 0 1px 4px rgba(0,0,0,.2); box-shadow: 0 1px 4px rgba(0,0,0,.2); zoom: 1; }
.flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; transition: all 1s ease; }
.loading .flex-viewport { max-height: 300px; }
.flexslider .slides { zoom: 1; }
/* Direction Nav */
.flex-direction-nav {*height: 0;}
.flex-direction-nav a { text-decoration:none; display: block; width: 40px; height: 40px; margin: -20px 0 0; position: absolute; top: 50%; z-index: 10; overflow: hidden; opacity: 0; cursor: pointer; color: #a5d4ff; text-shadow: 1px 1px 0 rgba(255,255,255,0.3); -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; }
.flex-direction-nav .flex-prev { left: -50px; }
.flex-direction-nav .flex-next { right: -50px; text-align: right; }
.flexslider:hover .flex-prev { opacity: 0.7; left: 10px; }
.flexslider:hover .flex-next { opacity: 0.7; right: 10px; }
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover { opacity: 1; }
.flex-direction-nav .flex-disabled { opacity: 0!important; filter:alpha(opacity=0); cursor: default; }
.flex-direction-nav a:before { font-family: "flexslider-icon"; font-size: 40px; line-height:1; display: inline-block; content: '\f001'; }
.flex-direction-nav a.flex-next:before { content: '\f002'; }
/* Pause/Play */
.flex-pauseplay a { display: block; width: 20px; height: 20px; position: absolute; bottom: 5px; left: 10px; opacity: 0.8; z-index: 10; overflow: hidden; cursor: pointer; color: #000; }
.flex-pauseplay a:before { font-family: "flexslider-icon"; font-size: 20px; display: inline-block; content: '\f004'; }
.flex-pauseplay a:hover { opacity: 1; }
.flex-pauseplay a.flex-play:before { content: '\f003'; }
/* Control Nav */
.flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;}
.flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
.flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; -webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -moz-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -o-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); box-shadow: inset 0 0 3px rgba(0,0,0,0.3); }
.flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
.flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }
.flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
.flex-control-thumbs li {width: 25%; float: left; margin: 0;}
.flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
.flex-control-thumbs img:hover {opacity: 1;}
.flex-control-thumbs .flex-active {opacity: 1; cursor: default;}
#media screen and (max-width: 860px) {
.flex-direction-nav .flex-prev { opacity: 1; left: 10px;}
.flex-direction-nav .flex-next { opacity: 1; right: 10px;}
}
You can use this updated version of FlexSlider that has RTL support: https://github.com/layalk/FlexSlider
$('#flexslider').flexslider({rtl:true});
You also need to include the flexslider-rtl.css file after the flexslider.css file.
I have a subnav that has a border-bottom under each of the sub menu items, when I was checking to see if it was ok in all the browsers I noticed that the border-bottom stopped where the text ended in IE7.
Here is my css
.subnav_wrapper_ul {
background: none repeat scroll 0 0 #00AEEF;
font-size: 13px !important;
position: absolute;
top: 34px;
z-index: 1000;
}
.header-wrapper .main-nav li {
float: left;
list-style: none outside none;
position: relative;
white-space: nowrap;
z-index: 1000;
}
.subnav_wrapper_ul li {
border-bottom: 1px dotted #FFFFFF;
float: none !important;
padding: 0;
width: 100%;
}
if there is anything else that you need from me please let me know
Give the border-bottom css property to the ul element , instead of the individual li items.
.subnav_wrapper_ul {
background: none repeat scroll 0 0 #00AEEF;
font-size: 13px !important;
position: absolute;
top: 34px;
z-index: 1000;
border-bottom: 1px dotted #FFFFFF;
}
We don't have any link or any image for reference, so in this case we all have to guess.
anyway you are talking about submenu section. can we use a IE7 specific hack here..
*:first-child+html .subnav_wrapper_ul li {
border-bottom: 1px dotted #FFFFFF;
float: none !important;
padding: 0;
width: 100%;
}
Another way to target IE7 is:
*border-bottom: 1px dotted #FFFFFF;
I am just cleaning up some CSS for a client.
I am not a front-end person, but have been saved by bootstrap (thank you, twitter).
However, I am having a really hard time cleaning up a custom navigation panel
(no twitter). I have provided the CSS below. I need it to be able to:
1) close gracefully at the end (the beginning starts with a vertical border, not an arrow.
I would like the end to have symmetry and close the way it began).
2) Get the container to not expand to the end of the page.
3) I can't seem to get it to work in chrome. It falls apart in chrome but works in IE and Ff.
Here is the link. Any advice? Thanks so much.
http://annualdinnerdev.elasticbeanstalk.com/
/* ------- Wizard Interface ---------- */
#wizHeader
{
border: solid 3px #fff;
margin-bottom:25px;
-moz-box-shadow: 3px 3px 4px #C2CBCE;
-webkit-box-shadow: 3px 3px 4px #C2CBCE;
box-shadow: 3px 3px 4px #C2CBCE; /* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#C2CBCE')"; /* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color= '#C2CBCE' );
}
#wizHeader li label
{
font-size:x-large;
}
#wizHeader li a
{
font-size:large;
}
#wizHeader li .prevStep
{
background-color: #D6E6FA;
color:#000;
}
#wizHeader li .prevStep:after
{
border-left-color: #D6E6FA !important;
}
#wizHeader li .currentStep
{
background-color: #6699CC;
color:#fff;
}
#wizHeader li .currentStep:after
{
border-left-color: #6699CC !important;
}
#wizHeader li .nextStep
{
background-color: #F0E9EA;
color:gray;
}
#wizHeader li .nextStep:after
{
border-left-color: #F0E9EA !important;
}
#wizHeader
{
list-style: none;
overflow: hidden;
font: 14px Helvetica, Arial, Sans-Serif;
margin: 0px;
padding: 0px;
}
#wizHeader li
{
float: left;
}
#wizHeader li a
{
color: white;
text-decoration: none;
padding: 10px 0 10px 55px;
background: brown; /* fallback color */
background: hsla(34,85%,35%,1);
position: relative;
display: block;
float: left;
}
#wizHeader li a:after
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(34,85%,35%,1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
#wizHeader li a:before
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 35px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
#wizHeader li:first-child a
{
padding-left: 10px;
}
#wizHeader li:last-child
{
padding-right: 18px;
}
Add a background color to #wizHeader to create the visual of a right-side border.
Specify a width value in #wizHeader to prevent it from expanding to the right of the page.
It seems to be working fine on Chrome for me (latest version)
Here are some examples of declarations to add to #wizHeader (add these to the ones currently in the CSS declaration)
#wizHeader {
background: #6699CC;
width: 960px;
}
Adding more based on comment...
The reason the arrows are being bumped down is because the 's are block elements, floated left, so they'll flow to fit whatever width they have available and drop down onto the next line when they run out.
If you want to cut off the last arrow, you'll have better luck by targeting the that wraps the last . This worked for me, editing in Chrome's Inspector:
#wizHeader li:last-child {
width: 172px; /* you might have to tweak this a bit*/
overflow: hidden;
padding-right: 0;
}
Then, change the width of the #wizHeader accordingly. 930px wide seemed to do the trick with the above snippet.