Webkit browsers, IE7 search form problem - html

Here is the link to my website thats still under development. It runs well in Internet Explorer 8 and 9 as well as in Firefox. The webkit browsers (Safari and Chrome) are not able to display the facebook "like box" properly. The box goes above the dividing line. While in IE7 for some strange reason the search form doesnt float:right.
This is my first website so sorry for any pathetic questions:) Can u also please tell me to write a script for IE6 that would show a message to upgrade to a modern browser because IE6 absolutely messes everything up. Any other suggestions would be highly appreciated. I have used the toolbox theme for Wordpress to develop this blog.
I have used :
time.entry-date {color:#000; font-style:italic; text-decoration:none;}
To change the post date's color to black and remove the underline but the text-decoration:none does not work.

Facebook follow box :
#fb-root {
position:relative;
float: left;
margin-left: 10px;
/* remove: margin-top, z-index */
}
HTML5 elements are not recognised by ie < 9. Add to page <head>:
<!--[if lte IE 8]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
JQuery for ie6 message:
if ($.browser.msie && parseInt($.browser.version) =< 6) {
var here = ' here';
$('body').prepend('<div id="message">Please upgrade your browser'+here+'!</div>')
}
Hope it helps.

Related

a tag background image not showing on ie7

I have some a tag that are assigned to class like: class='user-home' and I'm using this css to achieve background image:
.user-options .user-home{
background-image:url('../../img/user-home.png');
background-position:center;
background-size: 14px 14px;
background-repeat:no-repeat;
border: none;
}
And the problem- This is what I'm getting on chrome/mozila/ie11
This is what I'm getting on ie7
What will be the solution? Thanks.
The rule background-size is not supported on ie7. It is recommended to use small images (14X14) and not resize it with CSS rules, this way you're saving traffic and improving your page loading time.
There is a workaround (how-do-i-make-background-size-work-in-ie) but I still think it's better to just resize your image.
That's because background-size is a CSS3 property which isn't supported before IE9...
CSS background-size not working in IE7/8
Only solution i think is to edit image to 14px 14px
The browsers like IE7 do not support CSS3 properties. So you cannot use them otherwise you get these types of results.
You need to change the background-image CSS to this:
.user-options .user-home{
background-image:url('../../img/user-home.png');
background-position:center;
background-repeat:no-repeat;
border: none;
}
and now, edit the image resolutions and change its width and height to 14x14 yourself.
Or if you want to use the current CSS, please go to this website from Google:
https://code.google.com/p/ie7-js/
And from there, include the JS needed to make the IE behave like a standard browser, this is the code:
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js">
</script>
<![endif]-->
This JS will enable almost many of the CSS and HTML attributes. This should be included in head element.
Are you sure it's IE7 not the compatibility view (IE6) anyway background-size wont work with IE7
A way of your question, Earlier I used to use DD_belatedPNG Javascript to fix PNG issues in IE6
you may use one of the following tools to fix all IE issues:
Normalize
ie7-js
respond.min.js
For other HTML5 fixes and Media Query I use excanvas.js and respond.js
Code could be as follows:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

Safari css hack working on IE8

In a html page support these browsers Mozilla Firefox14, IE8, Safari5.1.1, Chrome19.
Since to support all these browsers I have to use css hacks in order to maintain the proper alignment of the elements on page.
Below is the css:
For Mozilla Firefox and IE8:
.dis_stats
{
position:absolute;
margin-top:-30px;
margin-left:-190px;
background:#E0E0E0;
width:141px;
height:80px;
_position:relative;
_margin-top:-460px;
_margin-left:115px;
}
For Safari & Chrome:
#media screen and (-webkit-min-device-pixel-ratio:0) {
.dis_stats
{
position:absolute;
background:#E0E0E0;
margin-top:-30px;
margin-left:731px;
width:141;
height:80;
}
}
Now what is happening on Mozilla it is running perfectly. But on IE8 it is applying the properties defined for Safari & Chrome and if I remove any of the Safari & Chrome's property then it will pick the same from intended properties (i.e defined for IE8 & Mozilla).
I am not getting any clue why is this happening. Anyone please suggest what is wrong here?
I recommend trying to work out a version that complies with standards and doesn't need hacks.
But if you must hack, you can consider conditional comments specially for IE 8 with separate stylesheet that fixes its problems:
<!--[if lt IE 8]>
<style type="text/css" src="path/to/ie-only-style.css">
<![endif]-->
This doesn't really explain what's wrong with IE, but can solve some IE-specific problems without using too much time (at cost of maintainability).

Conditional Comments within CSS

I am currently developing a theme for a homepage but ran into a few problems. For whatever reason I have no access to editing the html code itself, and I need to write custom .css for IE (specifically versions below IE9).
I have "two" issues. First one is dual backgrounds. Versions below IE9 can't seem to render them flawlessly. If IE skips the element, this is fine but since the graphic in this element co-works with another element (for a smooth graphical transition), it makes the other element look weird. The graphic in this second element is a background within a div-box. I want this background to be another custom background that's only rendered if the user is using IE as browser; and if possible, I want this to only apply to versions below IE9 (site is rendered with dual backgrounds just fine in IE9).
http://patrikarvidsson.com/project/sohelp/illustration.jpg
CSS is as follows (#mainframe is the part under the header navigation box). The lower image is how it is rendered in IE8. IE7 shows the same. First one is FF/Chrome/Safari and IE9.
#mainframe {
background: url('img/bg2.png') no-repeat,
url('img/bg1.png') repeat-y !important;
}
I've searched quite a lot on the net, also been asking friends and this does not seem to be working without writing conditional comments within the html markup. Am I missing something? Is this doable somehow with only the use of .css files?
Site is using jquery. I don't know this stuff, but I thought I'd mention it just in case.
You might want to look into this article which explains how to use conditional comments to set classes on the html element. You can then use that class to target specific browsers in your stylesheet, in a clean way.
Your html tag would look something like this:
<!--[if lt IE 7]> <html class="ie6"> <![endif]-->
<!--[if IE 7]> <html class="ie7"> <![endif]-->
<!--[if IE 8]> <html class="ie8"> <![endif]-->
<!--[if IE 9]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
Edit 2
Since the announcement that IE10 will not support conditional comments I though it would be nice to update this answer. I tested the type of comments it will support and it seems that the above will still work, but if you want to target higher than 10 or only 10 you will be out of luck. As suggested by Microsoft themselves on their blog (link in comments #MarcoDemaio) you should use feature detection.
Then you can do something like this in your css:
.somestyle {
background: transparent url('derp.jpg') no-repeat;
}
/* ie6 fallsback class */
.ie6 .somestyle {
background: #eee;
}
Read the article, and good luck ;)
Edit 2:
Since IE7 isn't my greatest concern anymore and IE9 is pretty consistent in its behaviour I can get away wil just the following code (which will add a class only for IE versions less than IE9):
<!--[if lt IE 9]><html class="lte9"><![endif]-->
<!--[if gt IE 8|!IE]><!--><html><!--<![endif]-->
Edit 1:
Ok I managed to miss your "can't edit html" comment.
In that case you can only use browser specific hacks, I think they're dirty as hell but hey, if you have no other option......
Somthing like this:
.someclass {
*color: blue; /* IE 7 and below */
_color: blue; /* IE 6 */
}
/* IE6, IE7 - asterisk hack */
.someclass { *color: blue; }
/* IE8 - winning hack */
.someclass { color: blue\0/; } /* must be last declaration in the selector's ruleset */
For your dual backgrounds problem, you simply need to add another containing element.
<div class="element">
...
</div>
becomes
<div class="container">
<div class="element">
...
</div>
</div>
I'm not sure why you wouldn't be able to manually edit the HTML, but if you have access to a javascript file and you're using jQuery, you can add the class like so:
$('.element').wrap('<div class="container" />');
You can use CSS hacks to avoid using conditional comments. CSS hacks aren't as commonly used now since the average user uses a browser that doesn't require any hacks to display properly, but it is still a completely valid and reliable way to avoid using HTML conditional statements. Depending on the specificity you want, you have a bunch of different hacks that you can use to only target specific versions of IE:
* html .element { color: #fff; /* IE6 only */ }
html .element { _color: #333; /* IE7 only */
*+html .element { color: #999; /* IE7 only */ }
html .element { *color: #000; /* IE7 and below */
html .element { color: #ccc\9; /* IE8 and below */ }
So:
#container { background: url(img/bg1.png) repeat-y\9; }
#container #mainframe {
background: url('img/bg2.png') no-repeat, url('img/bg1.png') repeat-y !important;
background: url('img/bg2.png') no-repeat\9; }
I had this problem in my CMS application so...
Create a container div have it's class the browser name and version to be looks like
<div class="ie_6_0">
<div class="your_custom_elements">
///////
</div>
</div>
and do you CSS classes like
.your_custom_elements{common styles between versions}
.ie_6_0 .your_custom_elements{do somthink for old versions}
.ie_9_0 .your_custom_elements{do somthink for new versions}
UPDATE 1
or like
<div id="mainframe" class="ie_6_0">
///
</div>
and CSS like
#mainframe{common styles between versions}
#mainframe.ie_6_0{do somthink for old versions}
#mainframe.ie_9_0{do somthink for new versions}
ie_6_0: as your user browser name and version must request it and add it by code.

Noob HTML help: IE8 Compatibility mode problem with Silverlight 3 app

If you look at this website with IE8 there a scrollbar on the right... How can I get rid of it? Any ideas pr tools that could help me find the error?
http://www.photocabana.net/
Does not work with IE8 Compat Mode = Off
Works in IE8 Compat Mode = On
Works in Firefox
Works in Chrome
If you use overflow:hidden on the HTML element and the BODY that should get it working in IE7 also.
Another option for your site if it's IE7 compatible already is:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
http://msdn.microsoft.com/en-us/library/aa374783(VS.85).aspx
This will buy you time until you can get everything right in IE8 native.
include this in your <head> element:
<style>
html, body {
overlow-y: hidden;
}
</style>
This is css that hide the scrollbar in the html and body tags.
http://www.w3schools.com/cssref/css3_pr_overflow-y.asp

Displaying Angle Symbol in HTML

The HTML symbol for angle, ∠ (∠) does not work in IE 6 or 7. What are the other alternatives to display the symbol in Internet Explorer ?
You could use a solution that incorporates both Jamie's and Shoban's answers and adds some conditional comments:
<style type="text/css">
span.ang { display: inline; }
span.ang_ie { display: none; }
</style>
<!--[if IE]>
<style type="text/css">
span.ang { display: none; }
span.ang_ie { display: inline; font-family: Symbol; }
</style>
<![endif]-->
<span class="ang">∠</span><span class="ang_ie">Ð</span>
The above works on Windows in IE6, 7 & 8, Firefox 2 & 3, Opera 9.6 and Google Chrome 1.
It does not work in Safari for Windows 3 or 4. Safari for Windows renders a square for ∠ (and ∠). If Safari for Windows support is required, you are going to have to combine JavaScript to detect IE and Safari with Jamie's replace with image solution.
Try using this
∠
<FONT FACE="Symbol">Ð</FONT>
I have checked and it works in ie7 :). http://comers.citadel.edu/math_sym2005.htm
Try surrounding the angle with a
<span class="ang">∠</span>
then, if the browser is IE, show an image of the angle there using CSS.
See this article on attaching images with css:
http://www.hunlock.com/blogs/Attach_icons_to_anything_with_CSS
Looking at the problem from the other end, i.e. as a user who sees hollow squares for 〈 (but also 〈 and 〉), I found a solution for IE7 (on Windows XP):
In the Internet Properties (Sorry, I have only a German version here, so I don't know if this is the correct name.), go to Fonts, and set the text font to Arial Unicode MS or Lucida Sans Unicode.
Strange enough, even if a page doesn't use that font, just the setting causes IE7 to correctly interpret those HTML named entities.
Edit: Lucida Sans Unicode doesn't work for all entities. E.g., ∠ or ↩ display ok but 〈 and 〉 not.