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.
1 Answer 1
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.
10 Comments
display will make it work AND be vertically centered?Explore related questions
See similar questions with these tags.
display: tableand friends, so you're stuck with ugly workarounds if you want to use that. Fortunately, I don't see why you need to usedisplay: tableto create that layout, so you should just be able to remake it using techniques that IE7 supports. Would HTML/CSS doing that be a good answer?display: table;from the form then the contents of the form will not be vertically centered.