crossbrowsing ie8 under windows xp - html

So my nightmare have come true. I need to make this website im developinglook good not only for IE8 but for IE over Win XP, apparently this company still get support for XP and they have all their intranets working under XP.
After doing a first check on a virtual machine the website looks like hell even the layout was totally broken so i decided to use html5shiv js (that fixed the basic layout) besides things like reset all margins and paddings and <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><![endif]-->.
BUT everything still looks pretty messy, specially things like image re-sizing on the html for retina display matters (i know, LOL) and things that i float with display-block. I have read tons of things with the display-block situation over IE8 but i just cant find a way to make it work without changing all my display-blocks for floats or create another huge specific ie (under win xp..ugg) stylesheet.
Do you guys have a general advice in order to make my website (flat design nothing with transitions or anything fancy) at least look decent on ie8 under xp ? Any help will be really appreciated

I own (and use) a Windows XP machine in addition to something more modern and I actually still have IE6 on the XP machine so as a web designer, I am way too familiar about coding for something as quirky as IE.
One of the biggest and continuing quirks with IE is the fact that it is VERY unforgiving about processing CSS 'instructions'. Leave out one declaration - like heights and widths for example - and you get rubbish because the engine decides it will try to interpret as it will.
These quirks are annoying as heck to experience, but the truth is, these quirks can help you to become a stricter CSS coder.
That said, some thoughts to help avoid these particular problems:
1) Declare ALL dimensions of objects. This includes heights, widths, margins, and paddings.
IE does NOT like 'auto' sizes unless it is exceptionally obvious.
An example of 'exceptionally obvious' would be two blocks floated side by side both whose percent dimensions are explicitly declared which, when added together, equals to 99% (for the sake of the example) which leaves 1% explicitly available to be used as a margin space which can be calculated by IE correctly.
2) When using floats side by side and if the floats don't want to float politely next to each other, try adding this to the floated block element: display: inline;
Normal compliant browsers won't care about it and some designers will gripe about it being a 'hack' (and yes it is), but it's SHORT, sweet, and does the job without resorting to queries.
3) Make sure the container that holds the floats has overflow.
Some thoughts about 'pretty' vs 'older IE and people using XP':
1) If using CSS3 and having it render correctly is all that important to you, then I would suggest either a) use CSS3 for unimportant things only or b) create a stylesheet specifically for non-CSS3 browsers.
a) This way, if unimportant things don't load correctly (and don't cause cascading problems), big deal.
b) This way, so you can use CSS3 all you want however you want without worrying about how it will look for non-CSS3 browsers as you will have a separate stylesheet for them.
A thought on image scalability between browsers and operating systems:
1) This webpage HERE has a great discussion on Fluid Images and scalability and it also offers an approach for addressing image scaling in IE and Windows in particular.
You might have seen it already, but if you haven't, there it is.

Related

input[type=date]: handling cross-browser widths and whitespace

Here's a default input[type=date] example in a few browsers:
Both Edge Chromium and Chrome add a lot of unnecessary whitespace to the default width of an input[type=date], about 50px to each. In my particular case, I have a few of them in a very wide grid/table and the horizontal space is at a premium in order to fit all the complex form fields on the screen.
Ideally I would be able to use width: max-content to get those widths to tighten up, but that has no effect. (Or even better yet, that additional whitespace wouldn't exist at all by default.) If I set a specific width in CSS, all browsers start to overlap my date text around different values.
The only two options I can think of to fix my width problems are:
Browser-sniff and use different CSS selectors for different browsers. (I'm aware why this is bad practice and a terrible idea.)
Don't use input[type=date] and instead use a JavaScript datepicker or web component. (I don't love this because I think mobile browsers implement a much better datepicker than desktop browsers and I don't want to force one or the other on users.)
Anyone have any other suggestions? Here's a CodePen in case anyone wants to fork.

Check For CSS Differences Between OS's

I have an app that runs across a few different computers and I develop on Ubuntu using Chrome.
Normally my CSS layouts look ok on PC's running Windows, but I've been noticing that a few of my layouts will break when viewing on my co-worker's computers (instead of being side-to-side with floats, will break to a new line for example).
Generally removing a couple pixels on either side will take care of the inconsistencies. This got me to thinking, is there any way to check the display differences on CSS between OS's? Generally there are guidelines on cross-browser styling, but I don't seem to remember any places that show the differences between OS's.
Most likely, the problems you're seeing aren't related to the OS so much as which fonts are being used and precisely how they're rendered. Using default fonts, "ABC" might render 16px wide on Windows but only 15px wide on your flavor of Linux.
In general, it's a good idea to add in a little extra tolerance when sizing a box based on how long (in pixels) the text inside of it is.
You will have to test your css in different browsers. You must install as many browsers possible in your machine and check periodically.
Also, there are tools that render your site in different browsers and you can see snapshots.
like this one: http://browsershots.org/
it has a big list of browsers/OS to check.

How can I achieve pixel-perfect positioning and spacing of textual elements across browsers?

Right now, we are trying to achieve consistent formatting of textarea elements, across Safari/Chrome/Firefox/IE on Mac and Windows. I believe this may be a rabbit hole, since any combination thereof could produce formatting in a slightly different way -- maybe one combination adds a bit of padding to a div here differently than the others, another one breaks multi-line text there differently than the others, and so on.
Instead of using textarea (or div) elements, can we achieve pixel-perfect positioning using HTML5's canvas? Or using the Raphael JavaScript library? Or maybe some other JS library?
Mainly, by pixel-perfect, what I mean is any arbitrary text should get rendered in the exact same way (especially with respect to line breaks and padding) in any of the above-mentioned browsers.
(I'd prefer to avoid Flash-based solutions for the moment, unless that is the only solution...)
Send the text to the server, have the server render an image, display the image. VoilĂ .
I would say this is nearly impossible.
I would also say that there is no reason to have pixel perfect across all browsers because the overwhelming majority of visitors only view your site with one browser. And those who do visit your site in more than one browser (say at work and at home) are unlikely to notice elements that are off a few pixels or have slightly different border colors.
What we should be concerned about is that the content looks good in each browser.
That said, here's a great list of textarea tricks: http://css-tricks.com/6841-textarea-tricks/
One main reason that PDF exists is that browsers are not about pixel-identical layout but PDF is. Among other things, not even typefaces are guaranteed to be the same from one OS/browser to the next.
Even, if you don't let the browser position anything and you do all your own pixel level positioning, you still won't necessarily have the same fonts to work with. If you let the browser position anything, then you can have variations.
Would one solution be to begin your css with a clean slate? Give everything a known default?
For example, I start my css files like this so I always know what to expect:
*{
margin:0;
padding:0;
}
Is that what you're looking for? Similarly, you could change '*' to 'textarea'.
I'm not sure if it is possible, however one thing you may want to look into is using the web developer toolbar for firefox or the web developer add-on for chrome. There is an option to disable browser default styles. Check this and then style everything. The borders, border type, all margins, paddings, background colors, etc. Then reenable browser default styles and make sure it looks the same. If not, wash, rinse and repeat.
Also, if fonts play a part, you will have to embed them into the page since some operating systems may not have a particular font installed.

Fonts seem larger in IE7 & 8 - but only one one page of a site

In our current project, we have one particular page where, when viewed in IE7 or IE8, fonts seem .1 or .2 em larger than they should be. Having inspected the code and css, I cannot see where this is coming from. This issue affects ONLY ONE PAGE which is to all intents and purposes exactly the same as many others in the site, which display as expected.
Some things I have ruled out:
Text-size settings (it's not that, set to medium, and anyway if so why one page only)
DPI settings (same reason as above)
Browser zooming (it's set to 100% - the problem scales with the zoom setting, btw)
Browser-specific CSS (no browser specific rules are applied to the elements in question)
Stray font-size setting code in the markup (I've been through and eliminated this)
Voodoo (okay I haven't ruled this out - as my frustration increases I'm starting to think it might be this though)
The page displays as expected in Firefox. This is not a live site yet so unfortunately I can't point you at the URL.
Has anyone come across something similar and, if so, what was it?
Many thanks,
G
Without showing us or replicating it at least, asking is pretty much near useless but I suspect it's probably just a tag that wasn't closed on an element with an above average font size.
I'd recommend validating the HTML. If it's good, then it's hard to say without looking at the code/page.

IE6 fix for site

Here is the url to the site in question: http://www.katiesamsonlaxfest.com/index.html
The site looks fine in all the browsers except IE6 and below. I would like if possible to find an easy css fix because as you can see the content is not contained within the divs.
I recommend the YUI CSS Foundation (Reset, Fonts, Grids). I find far less IE issues when building sites this way and often it requires almost no IE fixes/hacks once built and tested in Firefox.
It may take a little effort to learn, but I consider this to be the easiest fix because it almost eliminates the need for IE specific CSS and it saves you time in the long-run.
There is no "easy fix". You need to address the problems one at a time.
You can add "IE6"-specific CSS by adding things like:
.box {
margin-left:20px;
_margin-left:15px; /* this is the ie-specific fix */
}
...etc.
Also, transparency doesn't work with 24-bit PNG files. Use 8-bit. They're only titles, you don't need 24-bit anyways (or just use GIF). This is why your titles have strange boxes around them.