Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:15:39+00:00 2026-05-29T22:15:39+00:00

I have a document using XHTML Transitional. In the body I use a <noscript>

  • 0

I have a document using XHTML Transitional. In the body I use a <noscript> tag with a <style type="text/css">.

I know that <style type="text/css"> is only allowed in the <head>, but still I need to have the CSS applied only if JavaScript isn’t detected.

How can I solve this problem, while still passing XHTML validation?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
  <noscript>
    <div id="section-featured-nojavascript" class="section">
      <style type="text/css">
        #featured, #section-portfolio { display:none; visibility:hidden }
      </style>
    </div>
  </noscript>
</body>

ERROR when validation using W3

document type does not allow element "style" here [XHTML 1.0 Transitional]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:15:42+00:00Added an answer on May 29, 2026 at 10:15 pm

    Don’t try to have a separate stylesheet. Use JS to add a js class to the <body> (or to remove a no-js class). Then use that as part of a descendent selector in your main stylesheet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using XHTML 1.0 Strict Document type. I have at the end of my
I have a bit of code that basically reads an XML document using the
I have an HTML document that is using to embed a control. In some
I have a few .Net projects that would benefit from using a document/object database
I have created an Excel document using OpenXml SDK 2.0, now I have to
Scenario: I have a document I created using LaTeX (my resume in this case),
I have a string containing XML document using LinqtoXML What is the best way
I have encountered odd behavior when using document.getElementById tonight. Duplicated in Firefox 3 and
I'm filling an XML document manually using C# and I need to have <data>
I have a report document created by Microsoft Reporting but instead of using its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.