I have a problem with my CSS on a website I'm working on.
For some reason the website's CSS works for FF 3 and IE 7 but of course MS complicates things as this doesn't work for IE 6.
The header looks squashed.
The trouble is that my client owns IE 6 and I was yelled at without knowing why.
My questions are:
Where can I get a test suite for all browsers?
How do I fix it? Can someone test it for me?
Here is the CSS for IE:
/* CSS Document */
#presentation{
position: relative;
margin: 0 auto;
width: 689px;
height: 586px;
z-index: 0;
}
#pretext{
position: absolute;
padding: 20px;
}
#cleft{
width:97px;
height:665px;
position: relative;
float: left;
}
#cright{
width:97px;
height:665px;
position: relative;
float: right;
}
Here is the html:
EDIT SO messes up with html.
Here is pastebin
Use the IETester to test it yourself :)
To solve your first problem: I'd recommend using a browser-specific style sheet.
Since you're using XHTML, you could use the following:
<!--[if lte IE 6]><link href="lte-ie-6.css" rel="stylesheet" type="text/css"><![endif]-->
The CSS file lte-ie-6.css would then only be read by IE6. You can use it to easily override other CSS that causes visual mishaps in IE6.
There is software, such as MultipleIE, Internet Explorer Collection and IETester, that can emulate different versions of IE. However, this doesn't always give accurate results. Microsoft's official answer to your last question would be: install Virtual PC and run IE6 on it.
Lately, Microsoft has been working on SuperPreview, an official website preview utility that does the same, but with reliable results. Read about SuperPreview and/or download it.
I'm afraid there is no easy answer to this problem. My advise to you is this:
Code using the smallest set of techniques you need to do what you want.
Make your code standards compliant.
Do at least some testing in each browser (+version) you need to support.
Write a letter of Complaint to Steve Balmer of Microsoft about IE. (Every self respecting web developer should do this).
Regards
Welcome to the world of browser CSS quirks. It is difficult indeed to get a nice working CSS based website that's consistent across browsers. You'll need to experiment a lot.
Sometimes you may be better off using a CSS framework like BlueprintCSS
Try viewing your site in various browsers under various platforms by using the BrowserShots service.
Multiple IE lets you easily install/run multiple versions of IE side by side.
I've had a look and one of your stylesheets set the height and width for #logopic
#logopic{
width: 50%;
height: auto;
vertical-align:bottom;}
Try the real hight and width of the image in there instead
width:699px;
height:126px;
Related
Are there are CSS compressors online which do not remove any of the CSS browser hacks.
E.g: Using: cleancss.com it makes no difference which options I set it will always remove the *display for IE display inline-block hack.
a {
border-radius:5px
display: inline-block;
*display: inline;
zoom: 1;
text-shadow: 0 2px 3px rgba(0,0,0,0.4);
-moz-border-radius:5px;-webkit-border-radius:5px;
}
CSS Compressor and Clean CSS usually work for me, although I prefer to use a different stylesheet for all previous versions of internet explorer. It is usually better to keep previous browser supporting css seprately. Or keep hacks in a seprate file and appened it to the compressed css.
In your case, however, the compressors do remove *
I do not know any online compressors which preserve the hacks, however, I can offer workarounds.
A solution would be to use hacks on selector rather than on attribute.
Here are a couple of examples :
* html #uno { color: red } /*IE6 and below*/
*+html #dos { color: red } /*IE7*/
Check here about the other hacks available : http://paulirish.com/2009/browser-specific-css-hacks/
If that does not work for you another workaround, might be a little tiresome, but before compression, add some unique value before a hack like
#uno {#HACK#display:inline;}
and then after compression using a text editor replace all #HACK# with *
This one worked for me using your test code - http://www.cssdrive.com/index.php/main/csscompressor
As did - http://iceyboard.no-ip.org/projects/css_compressor, http://www.refresh-sf.com/yui/ and http://tools.arantius.com/css-compressor
It might be worth googling your question before you actually post it on here. I did a search for "css compressor", opened the first 6 results and found those four all compressed your code without removing any of the hacks.
stackoverflow isn't supposed to be used to ask something you're too lazy to search for yourself.
Any of these four five online minifiers do their work in way you satisfied
http://www.creativyst.com/Prod/3/
http://www.cssdrive.com/compressor/compress.php
http://iceyboard.no-ip.org/projects/css_compressor
http://tools.arantius.com/css-compressor
http://www.cssdrive.com/index.php/main/csscompressor/ (thanx to #JFK)
And also a smart tool (developed and used by russian Yandex) has both online and back-end versions
http://css.github.com/csso/csso.html
Try Devilo.us, which is based on CSSTidy. You can select exactly how much it compresses and how.
http://css.github.com/csso/csso.html — this one worked for me. It is not only trim unused symbols, but also remove duplicate rules, and group selector if in help's make size smaller.
It is online version of following tool: https://github.com/css/csso
I have a JQ slideshow in a div on this page:
http://www.lucky-seed.com/web.html
and have a css sheet for IE with the following style:
.slideshow { height: 599px; width: 700px;
max-width: 700px
margin-top: 00px;
margin-left: 295px;
float:left;
position: relative;
display: inline;}
Where am I going wrong? It looks great in everything but IE, but once in IE, I can't seem to move the position around no matter what I do.
Thanks in advance for your insights.
Hello fellow Pittsburgher :P
You've got so many different, conflicting styles going on there. While it's not a specific answer, might I suggest using a CSS framework like Blueprint ( http://www.blueprintcss.org/ ) to better manage your columns with greater simplicity and let it worry about IE compatibility. Rolling columns yourself is usually unnecessary these days.
In ieweb.css, try changing the margin-top on .slidenav to 50px, instead of -20px.
That moves the arrows to approximately the same place that they are in Firefox.
It might be an idea to scrap the IE specific stylesheets and do them again if need be. If you remember your question from yesterday, you had a weird issue with comments. Those comments were causing parsing errors on your pages for IE, so I imagine a lot of the "fixes" in your IE stylesheets are no longer required now you've sorted those comments.
I'm using a fairly basic vertically expanding page layout in CSS, and I'm trying to adapt this layout so that my client can edit the page using templates in Dreamweaver. It's... well, rough going. I'm used to doing most of this stuff by hand, but it's working out fairly well.
I'm using a min-height trick similar to this page to get the content to expand nicely in the browser, for shorter pages viewable on large monitors. The code works perfectly in all browsers (not supporting anything older than IE7 for the site, and other browsers are fine) but Dreamweaver doesn't render the min-height properly.
I've been able to get it to work by using a .css file that only dreamweaver uses (it doesn't exist on the server) that makes it editable in dreamweaver, but if that file is committed, the magic breaks on the live site. This just feels like a dirty hack.
The quick way out, I guess, is this: is there a way to get dreamweaver to ignore a line of CSS, or to make it use a line of CSS that would be ignored by a real browser? Or, is there a way to get a min-height layout working properly in dreamweaver?
The code I'm using for this is basically the following:
Site Code:
html, body {
padding: 0px;
margin: 0px;
height: 100%;
}
body {
position: relative;
width: 100%;
height: 100%;
}
#mainFrame {
position: relative;
min-height: 100%;
width: 980px;
/*center in parent*/
margin-left: auto;
margin-right: auto;
}
and the code that makes dreamweaver happy:
html {
height: 100%;
}
#mainFrame {
height: 100%;
}
I read somewhere that Dreamweaver's layout engine was based on IE's rendering engine, which would probably explain most of the issues. I'm using CS3, and my client is using CS5, which is going to complicate things further down the line, but I'm already prepared for that. If anyone knows of a magic solution to this, I would appreciate it greatly, as I've kind of given up on it for now.
Thanks
I don't use Dreamweaver either, but this Adobe article on IE conditional comments might be relevant: I wonder if you can adjust the Dreamweaver preferences to load a conditional comment version string that would be ignored by a real browser.
i know this answer won't help.... but I personally (would) never rely on WYSIWYG-rendering.... i'm using DW CS5 myself, but only with code-view
I actually came up with my own answer for this, which is significant cheating, but it does work. The following utilized CSS comments to hide (from Dreamweaver) PHP code, which causes the server to spit out basically an empty file. Conditional comments are almost definitely a better way to do this, but it's still an interesting solution (I thought) and it might be useful to someone.
/* <?php if (false) { ?> */
body { /* some editor-only CSS */ }
/* <?php } ?> */
Having CSS layout issues with Internet Explorer 7 (big surprise). Upon using the Developer Tools to inspect the CSS, I discovered that some properties defined in the stylesheet are not appearing in the parsed CSS structure... THEN I saw THIS being shown as the parsed value for the background-image property:
background-image : url(/trunk/httpdocs/images/layout/HCBL_Homepage_01.jpg); WIDTH: 1200px;
pretty much obliterating the width property that was defined.
The actual code in the CSS file for this element:
div#header {
width: 1200px;
height: 100px;
margin-left: auto;
margin-right: auto;
background-image: url('/trunk/httpdocs/images/layout/HCBL_Homepage_01.jpg');
background-repeat: no-repeat;
}
If anyone could offer any insight, or provide a link describing this problem (and maybe a workaround...) I would be very appreciative.
Also, I am only interested in this from a parsing of the stylesheet and CSS syntax perspective. I am not concerned with rendering and display issues at the moment; I simply want to get IE 7 (and I have a feeling IE 6 will have similar issues) to recognize and parse ALL of the CSS properties that have been defined in the stylesheet.
Also, here is a
link to some static HTML and CSS
that illustrates the problem described.
Thanks in advance guys!
Are you sure that you have regular inverted commas around you url, not fancy curly ones? Do you get the same behaviour if you change them to quote marks?
I'm not 100% about your folder structure or how you are accessing your image but have you tried without the first slash or adding .. before the first slash?
Where are the CSS and JPG files located from your website's root directory?
For IE 6 we have plenty of bugs to bug us as a designer.
incorrect box model etc etc.
i have searched for fixes via JavaScript and found
[link text][1]
IE7.js
IE7 is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.
but do we have real life saver other than javascript via css.
Ways to deal with IE6 bugs with CSS? Sure.
See: http://www.quirksmode.org/css/condcom.html
for conditional comments
There are other ways, such as adding some specific characters in some CSS properties that get ignored in some browsers but not in others.
However, in some cases, web designers should be very cautious when using these.
The alternative is to live within the IE 6 world of bugs and design your pages to look right despite them. You can serve up different css for your IE6 clients, or even different html if necessary, depending on your design. In some cases, you can use one CSS file that will mean different things to IE6 clients, but that technique is problematic with respect to IE7 and 8.
this link is also handy one
How do you deal with Internet Explorer?
I never knew this - thanks svinto
"IE6 doesn't have the incorrect box model unless you have the wrong doctype. – svinto"
There are some simple stylesheet hacks that can modify the presentation in various internet explorer versions to solve your CSS problems. For example these three:
Simplified box model hack for IE4, IE5, IE5.5:
div.values { margin: 10px; m\argin: 20px; }
star html hack for IE4, IE5, IE5.5 and IE6:
* html div.values { margin: 5px; }
star first-child+html hack for IE7:
*:first-child+html div.values { margin: 5px; }
PNG transparancy issues could be solved with solutions like this:
<div style="width:50px;height:50px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/logo/logo.png');">
<img src="/images/logo/logo.png" height="50" width="50" alt="" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" />
</div>
Great info so far but one thing to note is that IE7.js doesn't fix pngs in all cases (at least last I looked). For instance, you won't be able to tile a background image with transparency.
In the case of DXImageTransform you may find that when this is applied to elements that contain links, those links are no longer 'clickable'. You can sometimes fix this by giving the parent element that has the transform applied to it static positioning and to position the child anchor element e.g.,
h2{
position:static;
zoom:1;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/mypng.png", sizingMethod="scale");
}
h2 a{
position:relative;
}
<h2><a href="" >a link!</a></h2>
If you have to do this sort of garbage put it in a separate stylesheet and control loading with conditional comments. If the design is of any complexity try you best not to support ie6 or <. If you can't avoid doing it, charge more ;). Sometimes that is enough to persuade someone that supporting ie6 isn't "worth their while".
why don't you try FireBug Light for IE? It's not as powerful as FireFox FireBug but can be helpful
Many bugs can be worked around in CSS using conditional comments or CSS selector hacks. But there are some bugs that CSS hacks alone cannot handle such as IE6's .multiple.class.selector.bug
There's another quick and dirty hack for IE6 styles
for e.g.
You can define the CSS as;
.divTitle
{
padding: 5px;
width: 600px;
_width: 590px;
}
All the other browsers picks up 600px as the width value & IE6 overwrites it & take 590px;
I've tested this in IE7 & FF as well.
Also you may want to check this link;
link text