views:

171

answers:

3

Following css renders differently depends on the browser (mainly with Firefox) Firefox: the border-left-style:dashed does not seem to take effect as desired and black lines are shown instead.

I have captured screen shots

FF-->

http://pixpin.com/images/81898090171964887806.jpg

IE6--> http://pixpin.com/images/32538710129638992535.jpg

Also font seems to be another issue using em as they respond relatively better in cross browser. When i used pixel its a mess but not sure em is better or not.

I am not a CSS expert and working with CSS makes me feel worse than dealing with a second hand car dealer.

.Main

{ font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.8em;
border:0px; } .Header { font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 1.2em; color:#666; background : url("../images/header.jpg") repeat-x top left; padding-left: 10px;
padding:4px; text-transform:uppercase; border:1px; border-collapse:collapse; border-bottom-width:thin; border-left-style:dashed;

} .Footer { color:#666; font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; } .Footer td { border-style:none; text-align:center; }

.Footer span { color:#666; font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; font-weight:bold; text-decoration:underline; border-style:none; }

.Footer a { font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; color:#666;

}

.Results-Item td { margin-left: 10px; vertical-align:middle; color:#666; background-color: white; font-size: 1.2em; padding:4px; font-family: Arial, "Trebuchet MS", Sans-Serif; padding-left: 10px;
line-height: 20px; border:1px; border-collapse:collapse; border-bottom-width:thin; border-left-style:dashed; }

.Results-AltItem td { margin-left: 10px; vertical-align:middle; color:#666; font-size: 1.2em; /* _font-size: 1.2em; /* IE6 hack */ padding:4px; font-family: Arial, "Trebuchet MS", Sans-Serif; background-color: #ccc; padding-left: 10px;
line-height: 20px; border:1px; border:1px; border-collapse:collapse; border-bottom-width:thin; border-left-style:dashed;

}

Amount

{ text-align:right; }

+1  A: 

Best way to keep these errors out is to use a CSS standarization (reset) base, such as the one provided by blueprint.

If you don't include everything on blueprint, at least include its reset.css file. It will get rid of the font and spacing unconsistent behaviour between navigators (I'm not sure about the border issues)

EDIT: This is all you need in order to install blueprint basic:

<link rel="stylesheet" href="/css/blueprint/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="/css/blueprint/print.css" type="text/css" media="print">
<!--[if lt IE 8]><link rel="stylesheet" href="/css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
egarcia
Actually with css mentioned in question, the fonts are managed to display quite same on FF and IE 7.The main problem with css is more you invest on it more it demands.I am trying to remain as simple as possible.I will try to use blueprint next time because right now I need to quickly fix the issue.
R.R
Testing blueprint is actually quite quick. I've included a sample code. Just download blueprint, make it available on /css/blueprint and include those three lines on the html, before including your own css. If you don't like it, remove the files and lines. It can save you lots of headhaches in the future.
egarcia
A: 

You can use either a CSS reset like the Meyers reset, or to separate IE from Firefox and the rest of the browsers, use Conditional Comments. Usually Firefox is the browser that displays things mostly correct, so when I make sites I make it in FF first, then change IE CSS to fit.

Put this into the <head> of your HTML page:

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="path-to-file/ie.css">
<![endif]-->

And setup some different CSS that works for IE in that stylesheet.

Important: border-left-style: dashed; is valid for Firefox, check your cascade for clashing border left attributes, put it after the border-collapse:collapse in your CSS, also add the ; to the end of that rule. You don't need it for the last rule in a CSS selector, but when you switch it, make sure you add it.

Hope that helps.

Kyle Sevenoaks
Yes, will do that but before that I need a way to produce dash line in Firefox, can you mention which property I can use with/replace "border-left-style:dashed" to product the dashed lines.
R.R
Updated my answer.
Kyle Sevenoaks
So I tried the updates you mentioned in the css but still black lines are shown in FF instead of dashed lines. I have updated the css in original question post.
R.R
Do you have a live example?
Kyle Sevenoaks
I have captured screen shots FF-->http://pixpin.com/images/81898090171964887806.jpgIE6-->http://pixpin.com/images/32538710129638992535.jpg
R.R
+1  A: 

Showing only the CSS is only showing half the picture and, without the html, makes anything said a wild guess. In any case, Firefox is showing what you wrote while IE makes things up as it goes along. Never, ever trust IE to do anything right. Always, always use a modern browser (anything but IE) to initially test your markup. But the multitude of bugs and quirks in IE are well known, as are the hacks to fix it.

A link to the offending page is worth a thousand guesses at the problem.

Rob
where are the dashlines in FF?
R.R
@R.R - While IE may show what you want, that doesn't mean your markup is written correctly. Again, without the html, pictures don't help much either.
Rob
@Rob, industry wide framework generate markup at runtime which we don't have control, and you should rather look into direction of providing some workarounds to make this css work on F.F. Thanks anyways.
R.R
@R.R - Then you're using the wrong framework. If it works in IE but not FF then your markup is wrong! My workaround is provided. Never, EVER use IE as a reference for how things should work.
Rob
You did't provide any workaround just a rant against IE which does not help :(
R.R
@R.R - You want a workaround rather than doing things correctly. That I can't and won't help you with. I said you needed to supply the HTML or, preferably, a link. I said IE WILL be the problem. Call it a rant but, nevertheless, it's the truth.
Rob
Not here to take dictation from you, clearly you are suffering from the case of over inflated ego.
R.R