Why IE7 and IE8 will show the first tab's content only? - html

I am working website designing as well as developing I have facing following problem please help me...!!!
I have three tabs Its woking perfectly on IE9, Firefox, Chrome, Safari and Opera.
I use CSS3 only & I dont want any scripting language & want to work perfectly on all browser help me...
u can see here also
My Html Code :
<article class="tabs">
<section id="tab1">
<h2>Tab 1</h2>
<p>This content appears on tab 1.</p>
</section>
<section id="tab2">
<h2>Tab 2</h2>
<p>This content appears on tab 2.</p>
</section>
<section id="tab3">
<h2>Tab 3</h2>
<p>This content appears on tab 3.</p>
</section>
</article>
& my css code is :
article.tabs
{
position: relative;
display: block;
width: 40em;
height: 15em;
margin: 2em auto;
}
article.tabs section
{
position: absolute;
display: block;
top: 1.8em;
left: 0;
height: 12em;
padding: 10px 20px;
background-color: #ddd;
border-radius: 5px;
box-shadow: 0 3px 3px rgba(0,0,0,0.1);
z-index: 0;
}
article.tabs section:first-child
{
z-index: 1;
}
article.tabs section h2
{
position: absolute;
font-size: 1em;
font-weight: normal;
width: 120px;
height: 1.8em;
top: -1.8em;
left: 10px;
padding: 0;
margin: 0;
color: #999;
background-color: #ddd;
border-radius: 5px 5px 0 0;
}
article.tabs section:nth-child(2) h2
{
left: 132px;
}
article.tabs section:nth-child(3) h2
{
left: 254px;
}
article.tabs section h2 a
{
display: block;
width: 100%;
line-height: 1.8em;
text-align: center;
text-decoration: none;
color: inherit;
outline: 0 none;
}
article.tabs section:target,
article.tabs section:target h2
{
color: #333;
background-color: #fff;
z-index: 2;
}
article.tabs section,
article.tabs section h2
{
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
thanks in advance...!!

The problem here is that you're using browser features that aren't supported in IE7/8.
:first-child is not available in IE7.
:nth-child() is not available in either IE7 or IE8.
:target is not available in IE7 or IE8.
transition is not available until IE10.
box-shadow, border-radius and rgba() colors are not supported in IE8 or earlier.
And most importantly of all, you're using HTML5 tags like section and article, which are not supported in IE8 and earlier.
Most of these points can be resolved with polyfill scripts, but since you stated that you don't want to use any scripts, then unfortunately you're a bit stuck.
Some things you can get around by simply using an older-style alternative if you really really don't want to use any scripts (eg use div tags instead of section and article), but the main point of your code is to provide a tabbing interface using CSS :target to switch tabs, and the short answer is that this is not going to work in IE8 or earlier, and I don't know of any non-scripting alternative.
So I think the real point here is that if you want to support IE7/8, you have to use some javascript code.
You can use polyfill scripts to back-port the CSS/HTML5 features you're using, which will mean that newer browsers that do support those features won't have to use the scripts, but older browsers will need them. Sorry about that.
More about Polyfills:
"Polyfill script" is a generic term for a wide range of javascript libraries that have been written specifically to give older browsers support for newer features (mostly they're aiming at old IE versions).
Each polyfill script is written to support specific browser features, so for code like yours, you may need several polyfills in order to get complete feature parity. However, in some cases, for the less important features, you may just want to leave it so that old IE versions don't get all the features -- eg border-radius is nice, but it won't break the site if it isn't support.
Some polyfills that will definitely help you:
Selectivizr -- adds support for CSS3 selectors like :nth-child(), :target, etc.
Modernizr -- adds support for HTML5 elements, and provides a feature detection framework for using other polyfills.
CSS3Pie -- adds support for border-radius, box-shadow and more.
There is also a big list of polyfill scripts listed here. Feel free to browse through the list and pick the ones you feel are most useful.
The one important thing to remember about all polyfills is that they are not official parts of the browser; they're just little JS libraries that someone has written. This means that they are not guaranteed to work 100%. They may solve the problem for the author, but may also have missing features or gaps in their functionality compared with the real feature in a modern browser. They may also slow things down and clash with each other (especially if you use several of them).
Again, you're going to have to live with this, because that's the nature of how things are when you want to support modern browser features in old browsers. There are limits to what can be done to add features to old browsers.
Ultimately, if you really need to work with modern features, you may need to stop supporting some older browsers entirely -- particularly IE7.

Related

Text is blurred when has transform: translate and it is adjacent to another element with an animation

In the following example a DIV containing some text (example A), get slightly blurred when has a transform: translate CSS applied.
When instead in Text example B, fonts is sharp.
The problem happens only on Google Chrome and works fine on FireFox 46.0.1.
I was able to reproduce it on:
Google Chrome Version 51.0.2704.84 m
Google Chrome Version 53.0.2768.0 canary (64-bit)
I would like to know, if there is a problem with my code, or it is a bug in Chrome.
Also any idea how to solve it is welcome, keeping in consideration I would like to keep transform: translate if possible, and I mainly targeting latest Chrome and FireFox.
Notes on what I have notice so far:
Blur effect happens with different level at different font-size.
Using webkit-font-smoothing : none; does not help.
Issue happens with any font (system default or custom).
I am using Window 8.1.
Here is a live example:
#test {
position: fixed;
font-size: 20px;
top: 60%;
left: 40%;
}
#splashScreen__spinner {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -90px);
width: 50px;
height: 50px;
}
#splashScreen__infos {
position: fixed;
font-size: 20px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-font-smoothing: none;
}
.loadingSpinner {
width: inherit;
height: inherit;
border: 5px solid #3498db;
border-top-color: rgba(0, 0, 0, 0);
border-left-color: rgba(0, 0, 0, 0);
border-radius: 50%;
animation: spinnerAnimation 0.7s infinite linear;
}
#keyframes spinnerAnimation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<body>
<div data-ntv-type="Spinner" class="spinner" id="splashScreen__spinner" widgetid="splashScreen__spinner">
<div id="splashScreen__spinner__spinner" class="loadingSpinner"></div>
</div>
<div id="splashScreen__infos">A) - We are loading your website. Please wait.</div>
<div id="test">B) - We are loading your website. Please wait.</div>
</body>
This is not a bug in your code, this is well known Webkit rendering bug. See for example: https://support.mozilla.org/pl/questions/1075185 (and many more threads on FF support forums).
In both Chrome and FF, in advanced browser settings you can turn off what is called "hardware acceleration". This setting exists to let your hardware "help out" browser when in comes to advanced graphics rendering. Hardware acceleration automatically turns on for elements that you use translate and some other rules on. This is actually sometimes used by inexperienced "css hackers" to achieve some better/clearer rendering in some cases.
But sometimes it causes more bad than good and this is your case. Once you turn hardware acceleration off in your browser the font is perfectly clear. Sadly there's no real solution code-wise, you can't force turning it off for a given element. We are dependent on Webkit devs fixing the rendering engine here. You can only hack around, like for example change font size to one which for no real reason renders better. Or change positioning in some way which doesn't involve translate. Best of luck to you.

Remove input[range] inner line

I would like to remove the inner line of the range-input (HTML5 Video Control). Is there any way?
Have a Look!
If this is simply an HTML <video> element then you are going to be rather limited as to how you can handle styling it. The appearance of these elements will differ from browser to browser as seen below :
Firefox
Google Chrome
Internet Explorer
Edge
These styles are extremely difficult and sometimes impossible to override (especially in any kind of consistent fashion) as they rely on styles that are browser-specific as seen below:
audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
-webkit-appearance: media-slider;
display: flex;
height: 8px;
background-color: transparent;
min-width: 25px;
color: inherit;
flex: 1 1 auto;
margin: 0px 15px 0px 0px;
padding: 0px;
border: initial;
}
or specifically for the range section :
input[type="range" i] {
color: rgb(196, 196, 196);
}
You could try to use a style that would explicitly override it, but your success may vary :
input[type="range" i] {
/* Attempt to hide this */
color: transparent!important;
}
If you are looking for something like that, you would probably be better off using a Javascript-based like JPlayer or MediaElement.js

Scrolling using marquee tag

I facing problem using marquee tag, when opening in the chrome browser looks perfectly but when we open in firefox there are totally black shows.
Do not use <marquee>
According to Wikipedia
The marquee tag is a non-standard HTML element which causes text to
scroll up, down, left or right automatically. The tag was first
introduced in early versions of Microsoft's Internet Explorer, and was
compared to Netscape's blink element, as a proprietary non-standard
extension to the HTML standard with usability problems. It is
deprecated by the W3C and not advised by them for use in any HTML
documents.
if you still want marquee to work as expected see this
http://remysharp.com/demo/marquee.html
Using just CSS, as your tags say, a solution would be to use keyframe animations. However, keyframe animations are not supported in IE9 or older (IE10 supports them and so do all current versions of Chrome, Firefox, Safari and Opera).
Example using keyframe animations: http://dabblet.com/gist/3155878
HTML
<div class="carousel-wrapper">
<ul class="logo-list">
<li><img src="logo-img1.jpg">
</li><li><img src="logo-img2.jpg">
</li><!--many more list items just like this-->
</ul>
</div>
Basic CSS
.carousel-wrapper {
width: 32em;
height: 9em;
margin: 10em auto;
padding: 0;
border: solid 1px #ccc;
overflow: hidden;
}
.logo-list {
margin: 0 0 0 16em;
padding: .5em 0;
white-space: nowrap;
animation: scrollme 35s infinite linear alternate;
}
.logo-list li {
padding: .25em;
display: inline-block;
}
.logo-list a {
width: 10em;
height: 7.5em;
border: solid 1px #ccc;
display: block;
}
#keyframes scrollme {
to {margin-left: -173em;}
/* 173em = 18 list items * 10.5em - 16em
(10.5em = 10em width + 2*.25em paddings left and right)
(16em = half the width of the wrapper) */
}
Solutions for IE9 and older:
1. Use JavaScript. With jQuery, it's as easy as:
$('.logo-list').animate({ marginLeft: '-173em'}, 35000, 'linear');​
Demo here http://jsfiddle.net/thebabydino/gTRXQ/1/
However, if JavaScript is disabled, the user will only see the first images (unless he selects and drags... which most users don't).
2. Just CSS. Well, the exact same effect (auto-scrolling) cannot be achieved, but there are a few options.
Fist of all, add .lt-ie9 and .ie9 classes on the <html> element:
<!--[if lt IE 9]><html class="lt-ie9"><![endif]-->
<!--[if IE 9]><html class="ie9"><![endif]-->
<!--[if gt IE 9]><!--><html><!--<![endif]-->
so that you could do something different.
a) First option: the ugly option. No auto-scrolling, just leave a horizontal scrollbar on the wrapper (and of course increase its height) so that the user can scoll to see all images.
.ie9 .carousel-wrapper, .lt-ie9 .carousel-wrapper {
height: 10em;
overflow-x: scroll;
}
b) Second option: works only when there aren't that many images. Stack them up and reveal them on hover - something like I did in this gallery: http://jsfiddle.net/thebabydino/F7MKy/6/
c) Option that will only work in IE9, but you could use option a) or b) as fallback for older versions. Add some kind of navigation, like this http://dabblet.com/gist/3156683 (view it in IE9).
d) Ugly option #2. Go back to marquee just for IE9 and older (using conditional comments).
What I would do:
To begin with, add a class .no-js to the <html>
Use Modernizr to remove it if JavaScript is not disabled. In this case, use the JavaScript version of the auto-scrolling.
If JavaScript is disabled, but animations are supported, use keyframe animations. In this case, the .no-js class was not removed, so:
.no-js .logo-list { animation: scrollme 35s infinite linear alternate; }
If neither JavaScript nor animations are supported, try another one of the options I've listed at point 2.
You should correct the structural errors in your site.
For instance, the marquee is inside an <ul> element, but outside of any <li> elements. I'm sure browsers will have a problem with this!
So make sure the site validates on http://validator.w3.org/ before continuing.

IE7 CSS div margin issue

I have a minor CSS problem, but I'm having trouble fixing it because I don't have any computer handy with IE7 installed...
In IE8, Chrome, FF, etc. I see this (correctly):
but IE7 gives me this:
the HTML code follows:
<div id="hub">
<div class="title highlight">Faster, Cheaper, Better</div>
<p>PNMS...
the relevant CSS code follows:
#hub {} /* literally nothing */
#hub div.title {
font-size: 4em;
font-style: italic;
font-variant: small-caps;
float: left;
margin: 5px 0px 20px 0px;
width: 940px; /* same as parent container */
}
.highlight { color: #ff6633;}
p {
text-indent: 30px;
font-size: 1.3em;
line-height: 1.1em;
letter-spacing: 1px;
margin: 5px;
}
Based on visitor traffic, I need my site to be compatible with IE7 (thankfully NOT IE6). But again, guessing blindly and then running browsershots.org is not a very efficient manner.
Can someone help? Thank you.
Found this somewhere, it may help:
CSS Double padding IE7 Fix
"Nothing is more annoying than finishing a web design, having it dispay just the way you like it in your standards compliant browser (cough download Firefox) only to remember to check it in IE and find it a garbled mess. Today I came across a rather annoying CSS bug in IE7. IE7 doubles the top padding on my navigation menu."
CSS Code
#nav {
clear: left;
padding: 16px 0 0 30px;
}
"And the fix…
Just add display: inline-block to the div with double padding. That’s it… I know, it’s ridiculous."
#nav {
clear: left;
display: inline-block;
padding: 16px 0 0 30px;
}
Another alternative is the parent of the Div which is not displaying correct add the margin: 0 in CSS for it.
Found it. The CSS body tag had a line-height: 18px;
For some reason known only to Microsoft, out of IE7, IE8, IE9, Firefox 3.5~6, and Chrome, only IE7 honored that instruction for a deeply nested div 400 lines further down the CSS sheet.

Absolute Block Nested in Relative Block Appears Lower in IE8

Ugh. I really, really hate cross-browser compatibility... I'm working on a Wordpress site for a client to create a popup box that appears just below the item I'm hovering over (using a custom shortcode). I have top set to 16px, and it works fine in Firefox. However, in IE8, it appears a lot further down. Even if I set top to "0", it still appears BELOW the containing blog, instead of at the top of it.
I also have a related issue, in that the font size in IE8 is about 2 pixels smaller. There is a <sup></sup> tag before this, as well, but removing it doesn't change much--the font size is still smaller in IE8.
Here is the page:
http://www.medicalmarcom.com/services/
Every question mark along the left side has a popup that appears when hovering over it (kinda like a tooltip). I need to make it work in FF, IE, Safari, and Chrome. The only one it doesn't work in is IE. Thankfully, he didn't mention IE6, so I'm not worrying about it unless he singles it out.
Here is the HTML:
<span class="questions"><sup>(
<div class="popup_content"><span class="popup">?</span>
<div class="popup_inside" style="display: none;">We’ll ask questions to understand your business, objectives, competitive situation, and positioning statement.<br />
<span style="color:#15398c"><em>Read More >>></em></span></div>
</div>
)</sup></span>
CSS:
.popup_content {
display: inline;
position: relative;
}
.popup_inside {
background-color: #FFF;
border: 1px solid #000;
text-align: left;
font-size: 12px;
color: #000;
width: 300px;
padding: 2px;
line-height: 1.5;
left: 0;
top: 16px;
z-index: 1001;
position: absolute;
display: none;
}
.popup {
position: relative;
z-index: 1000;
}
Ok, this is due to how ie8 is rendering the sup tag, I believe. It considers its baseline the same as the rest of the text, rather than above it. If you want to do this with just css, I'd consider rolling your own superscript class.
Here's a fiddle of something that seemed to work for me.
As an alternative solution, it seems to be rendering correctly in IE7, you could force IE8 into IE7 Compatibility Mode. Drop this line at the top of your <head>. I don't know what this will do to IE9, but it's worth a shot.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />