SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XHTML 1.0 strict and embedded css

    hello,

    newbie ...have read designing without tables and now I am here

    have got my site to XHTML 1.0 strict and I am trying to use embedded css in the header etc..

    have used

    <style type="text/css">

    <![CDATA[
    body {
    background:#eee;
    }
    ]]>

    </style>

    but it doesn't get recognised as style

    any ideas anyone?

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It is not supposed to see the CSS if you use <![CDATA[ ...Character Data... ]]> I suspect you are using XHTML served as text/html in that case might I suggest using:

    <style type="text/css">
    <!--
    body {
    background:#eee;
    }
    -->
    </style>

    Unless of course you are serving the XHTML as an application of XML like myself.

  3. #3
    SitePoint Member
    Join Date
    Jan 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bingo!

    thanks very much

  4. #4
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i usually don't bother with the commenting out of styles. only prehistoric browsers don't know how to handle style in the header...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    That's providing you don't use > etc. in the CSS block itself.


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
  •