954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Chrome not reading style correct

i have two seperate style sheets. one that needs to read FF and Chrome and a seperate style sheet for IE (conditional commenting) to fix all the bugs that IE has, but i now have a problem with Chrome not reading ONE style correct.

it's not reading my margin on the style for my navigation, and i have even tried addign -khtml- every where in the style to see if it might read it....

style

.navigation{
	font-size:70%;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-weight:bold;
	background-image:url(../images/NavigationSlice.jpg);
	background-repeat: repeat-x;
	background-color:#ffffff; 
	width: 101.3%;
	height:40px;
	margin-left:-5px;
}


not sure if i should rather paste my whole code for you to see??
but if you have experienced this problem before, and know a solution, your help would be much appreciated!! :)

MJ Pieterse
Junior Poster
145 posts since Mar 2009
Reputation Points: 13
Solved Threads: 18
 

Perahaps its a BUG!

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

Hi

Maybe that style is modified later on...

try

margin-left:-5px !important;

prateeksha
Newbie Poster
6 posts since Apr 2006
Reputation Points: 10
Solved Threads: 1
 

awe, still no luck. the only change that made was to make sure that IE reads that and doesn't change it when it reads the conditional comments page.

.:Why oh Why:.

thanks for your help, maybe i should just try something different...
have looked at everything and there doesn't seem to be a problem anywhere...

MJ Pieterse
Junior Poster
145 posts since Mar 2009
Reputation Points: 13
Solved Threads: 18
 

meaning: cripled Chrome doesn't support negative margins.

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

Negative numbers are not part of the W3C definition for margin. Browsers go into quirks mode when they encounter them.

Note that it is NOT necessary to make a separate style sheet for IE. I have been able to make web pages that render the same for all browsers. The trick is to not put size styles (width and height) and surrounding styles (margin, border, padding) on the same tag. Also, do not use anything that throws the browser into quirks mode, and do not use nonstandard extensions provided by some browsers.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

It is possible that you've confused margins with padding specifications since negative padding is not allowed and people us padding to achieve similar effect quite often and may confuse them. But negative margins are allowed and defined by W3C:

css2.1 box model http://www.w3.org/TR/CSS2/box.html
also defined and supported in CSS1
CSS1 box model http://www.w3.org/TR/REC-CSS1
definition sample[INDENT]
In the case of negative margins, the absolute maximum of the negative adjoining margins is deducted from the maximum of the positive adjoining margins. If there are no positive margins, the absolute maximum of the negative adjoining margins is deducted from zero. [/INDENT]

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

i'm not sure why it's doing that, because my IE is reading it correctly (without adding any negative margin) but i have to add the negative margin in order for FF to read it correctly. I'll just have to trail and error until something is fixed.

thanks so much for your responses!

MJ Pieterse
Junior Poster
145 posts since Mar 2009
Reputation Points: 13
Solved Threads: 18
 

i'm not sure why it's doing that, because my IE is reading it correctly (without adding any negative margin) but i have to add the negative margin in order for FF to read it correctly. I'll just have to trail and error until something is fixed.

thanks so much for your responses!


Can I see your code - It may be possible to fix it for all with one style sheet only.

Do you have it online?

Or can you post (copy- paste [exactly as is]) the HTML code of the, element preceding together with the code of element succeeding the problematic code to make sure it's not one of them profane browser mistakes not handling white-space as expected.

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You