943,522 Members | Top Members by Rank

Ad:
Sep 22nd, 2009
0

Chrome not reading style correct

Expand Post »
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

HTML and CSS Syntax (Toggle Plain Text)
  1. .navigation{
  2. font-size:70%;
  3. font-family:Verdana, Arial, Helvetica, sans-serif;
  4. font-weight:bold;
  5. background-image:url(../images/NavigationSlice.jpg);
  6. background-repeat: repeat-x;
  7. background-color:#ffffff;
  8. width: 101.3%;
  9. height:40px;
  10. margin-left:-5px;
  11. }

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!!
Last edited by MJ Pieterse; Sep 22nd, 2009 at 10:47 am.
Similar Threads
Reputation Points: 13
Solved Threads: 18
Junior Poster
MJ Pieterse is offline Offline
144 posts
since Mar 2009
Sep 22nd, 2009
0

Re: Chrome not reading style correct

Perahaps its a BUG!
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
505 posts
since Jun 2008
Sep 22nd, 2009
0

Re: Chrome not reading style correct

Hi

Maybe that style is modified later on...

try

margin-left:-5px !important;
Reputation Points: 10
Solved Threads: 1
Newbie Poster
prateeksha is offline Offline
6 posts
since Apr 2006
Sep 23rd, 2009
0

Re: Chrome not reading style correct

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...
Reputation Points: 13
Solved Threads: 18
Junior Poster
MJ Pieterse is offline Offline
144 posts
since Mar 2009
Sep 23rd, 2009
0

Re: Chrome not reading style correct

meaning: cripled Chrome doesn't support negative margins.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
505 posts
since Jun 2008
Sep 26th, 2009
0

Re: Chrome not reading style correct

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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Sep 26th, 2009
0

Re: Chrome not reading style correct

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

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.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
505 posts
since Jun 2008
Sep 28th, 2009
0

Re: Chrome not reading style correct

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!
Reputation Points: 13
Solved Threads: 18
Junior Poster
MJ Pieterse is offline Offline
144 posts
since Mar 2009
Sep 28th, 2009
0

Re: Chrome not reading style correct

Click to Expand / Collapse  Quote originally posted by mj080 ...
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.
Reputation Points: 120
Solved Threads: 61
Posting Pro
Troy III is offline Offline
505 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Help in HTML
Next Thread in HTML and CSS Forum Timeline: What do you think?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC