SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast Sarah Bellum's Avatar
    Join Date
    Jan 2009
    Location
    Danville, California
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy doctype declaration not working for firefox

    Hello folks, I posted a question yesterday about popup images not working correctly and got an immediate reply that I didn't have any doctype declarations, so I put them in and voila, it then worked ... HOWEVER, I now have the weird situation that whereas the CSS part seems to be working fine in all three of the browsers (IE8, Firefox, and Chrome), my blue horizontal lines have stopped working in Firefox!!! (top and bottom)

    I know this is not an HTML forum, but when I take away the doctype, the blue lines come back (in firefox) ... LINK Here's my doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    Both the other browsers are working fine as far as I can tell, only Firefox. Anybody have any ideas?

    Thanks, Jack

  2. #2
    SitePoint Enthusiast Sarah Bellum's Avatar
    Join Date
    Jan 2009
    Location
    Danville, California
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rather than make you search for it, this is the code FF can't handle when the doctype is declared:

    <tr>
    <td height="2" bgcolor="003399"></td> <!-- Blue HR -->
    </tr>

    With no doctype, this works fine. With the doctype, it becomes invisible (in FF)

    Thanks, Jack

  3. #3
    SitePoint Evangelist
    Join Date
    Sep 2006
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May be wrong but I don't think bgcolor is a valid attribute in strict. You will want to do something like this. I would probably bring in the height to CSS too. bgcolor and height="" are not CSS properties, they are HTML attributes.

    style="background-color:#003399;height:2px;"

    rather than using bgcolor.

  4. #4
    SitePoint Enthusiast Sarah Bellum's Avatar
    Join Date
    Jan 2009
    Location
    Danville, California
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OUCH, OUCH, OUCH, ... Guess what, FF needs the hash mark in front of the color declaration ... !

  5. #5
    SitePoint Enthusiast Sarah Bellum's Avatar
    Join Date
    Jan 2009
    Location
    Danville, California
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you RustBuddy!

  6. #6
    SitePoint Evangelist
    Join Date
    Sep 2006
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, you might want to consider checking out your code in a validator.

    Also would suggest removing all <font> tags you have. In most cases it looked like they could be replaced with <span> tags. The font tag has been deprecated.

    http://validator.w3.org/check?uri=ht...Inline&group=0

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    When you specify a doctype the rest of the page is supposed to be written using the language specified in the doctype. If you specify HTML 4 strict in the doctype then you can only use HTML 4 in the page. If you specify HTML 4 transitional then you can use old HTML 3.2 tahs as well as HTML 4 since that doctype is intended for old pages that are in the process of being converted to HTML 4.

    Just sticking any doctype on the front is the equivalent of:

    <french>This sentence is written in German</french>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    That markup is deprecated anyway, as HTML should not have styling because it is just a markup langauge, it's not suposed to style . Moving all that to CSS is recommended .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


Bookmarks

Posting Permissions

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