SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question doctype changes css

    Hello,

    I have the following problem. I am redesigning my site and I want to use XHTML instead of HTML. By adding the DOCTYPE definition to my document the layout changes.
    Background images in tables defined in CSS disapear by adding the doctype.
    (I am using a CSS class)

    Does anybody know how to solve this problem.


    Thank for any reaction.


    P.S. I added 2 versions of an example document. (with and without doctype definition).
    Attached Files Attached Files

  2. #2
    SitePoint Member
    Join Date
    Apr 2004
    Location
    America
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    both are the same in mozilla for me..

  3. #3
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by harkeyahh
    both are the same in mozilla for me..
    I use IE 6.0 and tested it in Netscape 7.0. Both browsers give the same output when the included image-file is in the same directory: doctype.html without image-background, nodoctype.html with image-background. Anyway, thanks for the reaction.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Remember that in standards mode you have to be more precise (and that xhtml is case sensitive).

    You have this class:
    Code:
    <table width="750" height="115" align="center" class="jsmenu_EN">
    But you don't have a style called that!

    You have style called:
    Code:
    table.jsmenu_en {
    background: url("some_logo.jpg") no-repeat top center
    }
    Which is not the same (jsmenu_en and jsmenu_EN).

    Change it to lower case and it will work

    Also note that there is no attribute for table called height in xhtml you will need to use css.
    Quote Originally Posted by validator
    Line 30, column 26: there is no attribute "height"
    <table width="750" height="115" align="center" class="jsmenu_en">
    Paul

  5. #5
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're right, thanks a lot. I feel a bit stupid.
    By the way, Paul, do you know a free XHTML validator program?

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Paul, do you know a free XHTML validator program?
    http://validator.w3.org/

    Not sure if thats what you meant as it seems to obvious


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
  •