Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    London, UK

    Whats wrong with my CSS? Works in Firefox but not IE

    Hi There,

    While developing my latest website i decided i'd use a fair bit of CSS for some floating tables.

    Works absolutely fine in Firefox.. but to my horror Internet Explorer takes my site and rips it to shreads!

    Can someone take a look at the CSS in the source and the problem area is the <divs> near the top.

    I can't work out how to fix it so it looks fine in both browsers

    Portfolio :: Click Here
    E-Mail :: [email protected]
    AIM :: robin hawkes
    MSN :: [email protected] (no e-mails to this please)

  2. #2
    Join Date
    Jun 2004
    Northwest Colorado
    Honestly, that shouldn't work in any browser. It looks nice when it does, though! That <style> section belongs within the <head> section, not after it.

    The best way to generate cross-browser compliant code is to learn how to use a validator to check your work. The following section illustrates a major problem:

    		<tr><td id="links_l"><b>MP3Car</b></td><td id="links_r">- CarPC Forum</td></tr>
    		<tr><td id="links_l"><b>DigitalCar</b></td><td id="links_r">- UK CarPC Forum</td></tr>
    		<tr><td id="links_l"><b>StevieG</b></td><td id="links_r">- Excellent CarPC</td></tr>
    		<tr><td id="links_l"><b>LinITX</b></td><td id="links_r">- UK CarPC Store</td></tr>
    		<tr><td id="links_l"><b>Mini-ITX</b></td><td id="links_r">- UK MiniITX Store</td></tr>
    An ID must be unique within a document. You can't have multiple id="links_l" attributes. If you need to re-use a style, then set a class for it, like class="links_l". Don't forget to change the style rule from #links_l to .links_l to indicate a class.

    I would also recommend renaming your styles, words like "left" and "float" are reserved words which shouldn't be used as class or id descriptors. Also, get rid of those font tags, you're using CSS so try setting those fonts with a style.
    Eric J. Bowman, principal
    Bison Systems Corporation coming soon: a new sig!
    I'm just a poor, unfrozen caveman Webmaster. Your new 'standards' frighten, and confuse me...

  3. #3
    BigBison is right, but you also have to keep in mind that CSS works/looks differently in different versions of IE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts