Is is possible to use flexbox on WebKit without declaring a <DOCTYPE>?
My project is constrained: I can modify CSS but I need to preserve existing HTML as much as possible, which does not include a <DOCTYPE>. Adding in flexbox declarations works on Firefox, but not Chrome/Safari.
Clarification
I am dealing with a very old codebase. I can modify HTML in place, but it is generally a bad idea in this situation. In testing, adding a DOCTYPE breaks way more than flexbox fixes.
(This seems like a basic question, but I can't seem to find this answer anywhere.)
You can use flex and it will work on chrome as well.
For checking any property you can take help from the below site:
caniuse.com
http://caniuse.com/#search=flex
Surely there is an easier way of doing this. The IE comment tags were the only way I could make the page look right in IE 7 and below.
EDIT: I'm not too sure why this got down-voted. It's a legitimate question. If anyone should get down-voted, it's those who have discussed this as of now. Nobody is answering the question. They are either too vague or telling me what not to do. I already know that. That is why I am asking what the better way is.
You shouldn't need to use an html table just to get IE7 working, and in fact you shouldn't use them at all if you're not intending to display tabular data.
Instead of all those messy conditions, just use one immediately after your stylesheet import to add an IE specific stylesheet.
Consider creating another container for your form, and instead of trying to make the form display as table use positioning to place your new container in the corner instead. This is more likely to translate well into older versions of IE, and so your IE specific styles will only be needed to correct minor box model differences.
I have this site and for some reason in IE7 I can't click in the search field on the top right. Every other browser is fine. I have not been able to check other versions of IE but I presume they are failing as well. What is going on?
Hard to say for sure since I don't have access to IE7 at the moment, but you might want to look into setting the z-index of the input or its container.
Also, when I looked at your HTML it looked like something was malformed because I saw the attribute "value" without a value. Double check all the HTML is correct.
Your link is password protected, but in addition to checking CSS z-index issues, you may want to try using the position: relative; and zoom: 1; properties in an IE7-conditional stylesheet — a combination of the two tends to fix a good portion of IE7 issues. If you don't have the IE Developer Toolbar, it's invaluable for resolving display and functional issues.
Take a look at this html page.
In Firefox it looks just like I want it to look, in IE it looks "a bit weird", and in Chrome it's all twisted.
What non-standard HTML I am using that makes it looks so different between browsers? Specifically, how can I fix the Chrome & IE versions to look more like Firefox?
Note that Chrome only goes haywire if all or almost all columns have the yellow stickies. If one or two columns are empty, then Chrome displays the page just like Firefox.
Edit - here is the fixed page.
The page doesn't have a DOCTYPE. It is important to have one to tell the browsers that your page is standards compliant. Start from there and ensure your page passes validation for your chosen DOCTYPE.
UPDATE: Good job on fixing the validation! Your problem now is that the table element follows two floated divs without any clearing. You must clear the floated elements so that the following elements are laid out correctly below them.
Try the following. Google "clearfix" for a more elegant solution.
<div style="float:left">....
<div style="float:right">....
<br style="clear:both"/>
<table ....
One of the first things I'd have to suggest is making sure that your code is valid if you want cross-browser friendly.
The posted code comes up with 33 errors.
FF isn't quite as picky as some other browsers can be, and gives a lot of leeway in terms of valid code.
Try validating and fixing the problems with validity, then check it again; it might look at least a bit better.
Try validating your CSS and HTML if possible. That usually helps remove the biggest of glitches.
validator.w3.org
Float your calendar table to the left
Generally, what's the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page suddenly looks like a monkey coded it?
First Things First
Get yourself the Internet Explorer Developer Toolbar. It's a life saver and works great with IE6 and/or IE7. It's no replacement for Web Developer Toolbar or Firebug for Firefox, but it's better than nothing.
Know Thy Enemy
Read up on the quirks of IE — particularly hasLayout and overflow and the like. There are also many CSS niceties that you'll have to either do without or find alternatives. Look into how many of the popular JavaScript toolkits/frameworks/libraries get around different issues.
Rome Wasn't Built in a Day
The more you have to work with it, the more you'll remember off hand and won't have to lookup as often. There's just no replacement for experience in this. As several have pointed out, though, there are great resources out there on the net. Position Is Everything is certainly up there.
http://www.positioniseverything.net/ will certainly address your problem.
It provides comprehensive and in-depth descriptions of browser bugs along with options to work around them. A must read, in my opinion,
One good way to start learning about how IE happens to be mangling the page is to turn on red borders on different elements with CSS (border: 1px solid red;). This will immediately tell you whether it's a margin problem or a padding problem, how wide the element really is, etc.
The box model is usually the culprit. Basically what this means is that any div you are trying to position and use unsupported CSS with will cause this problem.
You may find it happens if you are using min-{width,height} or max-{width,height}.
this provides a great reference for checking compadibility with different versions.
http://www.aptana.com/reference/html/api/CSS.index.html
Noticed that Marc's post is at a -2 =D. He's only saying "resort to tables" even though they blow, because in sucky browsers like IE6, some of the broken CSS commands work in tables only (who know's why... dam you Bill Gates!!!). Here's a good reference to see what works and doesn't work as far as CSS goes. http://www.quirksmode.org/css/contents.html . It's a great reference to check on what cool effects work/don't work with various, widely used browsers. Also, always have a go-to plan for users who browse with IE6 (even though it's just about as old as mechanical dirt) as many businesses still use older browsers (including non-profits/3rd world countries etc.) So by all means, create the bugged out drop-down menu that looks WAY better than a standard horizontal menu, but create a secondary one specifically for IE6 that becomes the default when the page receives a request from an IE6 browser.
how do you define layout bug? the most frustrating layout implementation (i don't know if this should be defined as bug) in IE is we need to always specify style="display:inline" in the HTML <form> tag so that a blank line won't appear to disturb the form layout.
This question I believe has far too much scope.
Validate your code, and if pain persists, well, good luck.
The only real solutions, as with any other ballpark bug type are to google for a solution, or ask somebody who knows, ( ie: give the exact problem to us here at stackoverflow ).
You can use the IE Dev toolbar to glean an Idea, but many of the bugs are random, inexplicable, and esoteric. IE: the guillotine bug, the random item duplication bug, etc etc, the list goes on, and you can spend hours literally goofing with stupid variables everywhere and achieve nothing.
I have a simple strategy that works every time.
First, I develop the site using commonly accepted CSS to look good in Safari and Firefox 3. See w3schools.com for details on browser support.
Then, I go into IE6 and IE7 and alter the CSS using conditional includes.
This is hack free and lets you handle different browsers (IE6 and IE7 have separate issues).
Most of the issues you'll find come from unsupported features in IE (like min-width), errors in the box model (IE adds unseen extra padding (3px) to some boxes), or positioning issues. Go for those first as they are often the issue.
A common problem is padding not getting added to the width of a block element. So for layout div's, avoid using padding and instead use elements within them to define the padding.
I use Rafel Lima's Browser Selector when I need to tweak differences between IE/Standards browsers. It greatly reduces using "hacks" in your HTML to solve common problems.
You can target CSS statements for different browsers, or even different versions of browsers (Hello IE 6). It's very simple to implement, but requires the user has JavaScript turned on (most do).
.thing { ....}
.ie .thing { ....}
.ie6 .thing { ....}
We had a floating div issue that was only evident in a particular version of IE6. It was fixed by downloading the latest service pack.
In theory, use CSS compatible with IE6 layout bugs, utilise only well known workarounds (css and html filters) and code for them in a way that wont break forward compatibility, test for quirks/strict mode.
In reality, resort to tables.