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 8674899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:49:11+00:00 2026-06-12T19:49:11+00:00

have been using no DOCTYPE but rather simply starting with <html> as per HTML5

  • 0

have been using no DOCTYPE but rather simply starting with <html> as per HTML5 standards (as I understood them). everything going ok.

began using Jade, which insists on DOCTYPE. using <!DOCTYPE html> – pages no longer render correctly(?).

as an easy and trivial example (behavior is same on firefox and chrome):

<html>
    <body >
        <div style='height:50%; background-color:pink;'></div>
        <div style='height:50%; background-color:blue;'></div>
    </body>
</html>

render just fine – have page pink, half blue

<!DOCTYPE html>
<html>
    <body >
        <div style='height:50%; background-color:pink;'></div>
        <div style='height:50%; background-color:blue;'></div>
    </body>
</html>

renders two skinny DIV’s you can’t see.

  1. what’s going on?
  2. thought DOCTYPE was being deprecated for HTML5
  3. what should I be doing?
  • 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-06-12T19:49:12+00:00Added an answer on June 12, 2026 at 7:49 pm

    Whoever who told you that DOCTYPE is deprecated is either playing a prank on you or is plain ignorant.


    W3C on its article HTML5 differences from HTML4 on the section Syntax, sub section 2.2 clearly states this.

    The HTML syntax of HTML5 requires a doctype to be specified to ensure
    that the browser renders the page in standards mode. The doctype has
    no other purpose and is therefore optional for XML. Documents with an
    XML media type are always handled in standards mode. [DOCTYPE]

    The doctype declaration is <!DOCTYPE html> and is case-insensitive in
    the HTML syntax. Doctypes from earlier versions of HTML were longer
    because the HTML language was SGML-based and therefore required a
    reference to a DTD. With HTML5 this is no longer the case and the
    doctype is only needed to enable standards mode for documents written
    using the HTML syntax. Browsers already do this for <!DOCTYPE html>.

    And as to, why the behavior when you set <!DOCTYPE html> in your example.

    This behavior is expected. This is because body is a block level element. So it has height, by default, in a shrink-to-fit model and width, by default, in an expand-to-fit model. Setting style="height:100%;" in the body tag allows body to take up the whole of the height available and displays your two divs.

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

Sidebar

Related Questions

I have been using echo $.sprintf(%01\$.2f,$numvar); for my USD formatting, but I only copied
I have been using jQuery prettyPhoto plugin to show inline html content. This content
I have been using TortoiseSVN for some time and I really like it. I
I have been using Stanford POS Tagger to tag parts of speech in a
I have been using play 1.2.5rc4 for development of one app and I have
I have been using an API to do some work. This is how I
I have been using some Javascript to create a text field once an certain
I have been using the storyboard to make an application and currently there are
I have been using CI just fine using the MySQL driver. I want to
I have been using Matlab 2011b and contourf/contourfm to plot 2D data on a

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.