Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Location
    EIB Network
    Posts
    474

    * Inline CSS -> Set for deprecation

    On one of my web applications I am developing, I am having difficulty finding a way around using inline CSS (ie. <p style="color: #FFF;"> ) for a few various elements.

    I was wondering if inline CSS styling through the style attribute is set to be deprecated at any point in the future with XHTML? Is it perfectly acceptable to use inline styling like above? I have always done everything with external stylesheets, but on this particular application I am finding myself stuck with having to use inline CSS on a couple of occassions. Thank you for your help in this matter.
    People train run out of Stubville.

  2. #2
    Join Date
    Sep 2000
    Location
    Alberta, Canada
    Posts
    3,109
    I do not believe 'inline' styling is set to be deprecated within our Lifetime.

    What you could do though, for ease of use & reference, is to create a normal style in your CSS then document; the page, why that styling is used, etc.
    PotentProducts.com - for all your Hosting needs
    Helping people Host, Create and Maintain their Web Site
    ServerAdmin Services also available

  3. #3
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    I was wondering if inline CSS styling through the style attribute is set to be deprecated at any point in the future with XHTML?
    IIRC, inline styles are deprecated in XHTML 1.1, and are forbidden in the pending release of XHTML 2.0.

    Just set a class and set the style outside of the document structure in your style sheet.
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  4. #4
    Join Date
    Sep 2000
    Location
    Alberta, Canada
    Posts
    3,109
    Looks like I need to do more Book learning.
    PotentProducts.com - for all your Hosting needs
    Helping people Host, Create and Maintain their Web Site
    ServerAdmin Services also available

  5. #5
    Join Date
    Aug 2005
    Location
    EIB Network
    Posts
    474
    Quote Originally Posted by the_pm
    IIRC, inline styles are deprecated in XHTML 1.1, and are forbidden in the pending release of XHTML 2.0.

    Just set a class and set the style outside of the document structure in your style sheet.
    Hey thanks the_pm! When you say "set the style outside of the document structure" does that mean completely external? Or can I place the style in the <head> section (embedded CSS I believe it is called)?

    Because my styling is actually coming from a database, I am unsure how to handle this. And because to my knowledge I can't make an external CSS file be dynamic (ie. PHP)... I am unsure what to do. Thanks.
    People train run out of Stubville.

  6. #6
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    Why not simply store all of your style information inside a .css document? CSS allows you to keep style information in one spot without any redundancy. That's its charm

    If you're worried about being able to style it from a CMS-type editor, perhaps you have the ability to edit and save certain information as flat files?

    CSS within your <head> section is allowed in XHTML 1.1. I'm not sure about 2.0, but 2.0 is a working draft, not even close to release. So I wouldn't worry about it for the time being (it's going to be radically different from the (X)HTML to which we've grown accustomed).

    <style type="text/css">
    <![CDATA[
    .class { style:value; }
    ]]>
    </style>

    That's how you tell the XML parser to ignore the data within your <style> section. It's safe to use on XHTML 1.0 too.
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  7. #7
    Join Date
    Apr 2006
    Posts
    557
    Quote Originally Posted by seodevhead
    Because my styling is actually coming from a database, I am unsure how to handle this. And because to my knowledge I can't make an external CSS file be dynamic (ie. PHP).
    To make a PHP file act as a CSS file, and ultimately be dynamic, you would put it in a directory and then adjust how Apache handles CSS files so it would handle them as PHP files by putting (simplest way) an .htacces file in the same directory as the CSS files. Like so:

    AddType application/x-httpd-php css

    That way, you can put PHP code in your *.css files and it will work Oh, and you would want to make sure to set the content-type in the "PHP" file so it outputs the CSS file properly.

Posting Permissions

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