What is HTML <!DOCTYPE>?

EnglishCreated with Sketch.
EnglishFrench
  • Join  Lenovo Pro Business Store

    Log In / Sign Up

    Learn More

  • Accessibility
  • Sales:

    Home:

    1-855-253-6686 Option #2

    Business:

    1-866-426-0911

    Chat Now >

    Visit Sales Support Page >


    Order Support:

    Order Lookup >

    Visit Order Support Page >

    Technical Support >

Lenovo
All
  • All
  • Laptops
  • Desktops
  • Workstations
  • Monitors
  • PC Accessories & Electronics
  • Tablets
  • Servers & Storage
  • Servers Accessories
  • Sign In / Create Account
    My Lenovo Account
    Keep track of your wishlist, orders, and rewards all in one place
    Sign In / Create Account
    Welcome Back!
    Access your order, subscriptions, saved carts, rewards balance, and profile
    View My Account
    Orders
    View & track your orders
    Rewards
    Earn & redeem Rewards
    Profile
    Edit name, password, and account settings
    Wishlist
    Manage a wishlist of your favorite products
    Products
    Manage your devices, accessories
    Product Registration
    Register your product and/or update your warranty dates
    Lenovo Family Hub
    Manage your family's orders all in one place
    Sign Out
  • My Lenovo Rewards
  • Cart
  • Products
  • Solutions
  • Services
  • Support
  • About Lenovo
  • Deals
  • Business
  • Student
  • Gaming
  • Laptops

  • Desktops

  • Workstations

  • Accessories
  • Software
  • Monitors
  • Tablets

  • Servers & Storage
  • AI
  • Deals
TEMPORARILY UNAVAILABLE
DISCONTINUED
Temporary Unavailable
Cooming Soon!
. Additional units will be charged at the non-eCoupon price. Purchase additional now
We're sorry, the maximum quantity you are able to buy at this amazing eCoupon price is
Sign in or Create an Account to Save Your Cart!
Sign in or Create an Account to Join Rewards
View Cart
Remove
Your cart is empty! Don’t miss out on the latest products and savings — find your next favorite laptop, PC, or accessory today.
item(s) in cart
Some items in your cart are no longer available. Please visit cart for more details.
has been deleted
Please review your cart as items have changed.
of
Contains Add-ons
Subtotal
Proceed to Checkout
Yes
No
Popular Searches
What are you looking for today ?
Trending
Recent Searches
Items
All
Cancel
Top Suggestions
View All >
Starting at
  • Black Friday in July! Limited-time Doorbusters + Free shipping!  Shop Now >

  • My Lenovo Rewards! Earn 3%-9% in Rewards to use on future purchases at Lenovo.com Join for Free >

  • Business Financing Available. Split payments from 4 to 52 weeks, options as low as 0% interest. See Details >

  • Shopping for a business? New Lenovo Pro members get $100 off first order of $1,000+, exclusive savings & 1:1 tech support. Learn More >

  • Lenovo Live with Deepi: Black Friday in July + exclusive offer revealed on 7/16 @ 7pm ET! Register Today >

Home > Glossary > What is HTML <!DOCTYPE>?
Glossary Hero    
Learn More    
StarStar

Annual Sale

Lenovo Laptop SaleLenovo Laptop Sale

Laptop Deals

Desktop DealsDesktop Deals

Desktop Deals

Workstation DealsWorkstation Deals

Workstation Deals

ControllerController

Gaming PC & Accessory Deals

MouseMouse

PC Accessories & Electronics Deals

MonitorMonitor

Monitor Deals

Tablet and phoneTablet and phone

Tablets Deals

ServerServer

Server & Storage Deals

Discount tagDiscount tag

Clearance Sale


What is HTML <!DOCTYPE>?

HTML`<!DOCTYPE>` is a declaration that informs the web browser about the HTML (hypertext markup language) version used in the document. It ensures correct rendering by telling the browser which standards to follow. Placing it at the start of your HTML document before the `<html>` tag prevents quirks mode and enables standards mode. This results in consistent webpage display across different browsers and platforms.

What does <!DOCTYPE HTML> specifically tell a web browser?

`<!DOCTYPE HTML>` tells the web browser that you are using HTML5 (hypertext markup language). This ensures the browser renders the page according to HTML5 specifications. It enables the use of the latest web technologies and ensures correct display of your content.

What comes after the <!DOCTYPE> declaration in an HTML document?

After the `<!DOCTYPE>` declaration, you should start the HTML (hypertext markup language) document with the `<html>` tag, followed by the `<head>` section, and then the `<body>`. The `<head>` contains metadata and links to scripts and style sheets, while the `<body>` holds the content of your webpage.

Can <!DOCTYPE> declaration be used for languages other than HTML, like XML?

Yes, the `<!DOCTYPE>` declaration can also be used in extensible markup language (XML) documents to define the document structure and type. In XML, it is used to reference a Document Type Definition (DTD) that describes the structure, elements, and attributes the document will be used.

How does <!DOCTYPE HTML> differ from earlier versions of the DOCTYPE declaration?

`<!DOCTYPE HTML>` is simpler and shorter than earlier versions, because it does not require a reference to a DTD. Previous versions, like HTML 4.01, required a full uniform resource identifier (URI) to the DTD to validate the document against specific standards. HTML5 simplifies this by using a standard mode enabled by the simple `<!DOCTYPE HTML>` declaration.

Why is the <!DOCTYPE> declaration important for HTML validation?

The `<!DOCTYPE>` declaration is crucial for HTML (hypertext markup language) validation, because it specifies which version of HTML the document is using. Validators use this information to check your document against the correct syntax rules, ensuring your code meets the standards and will work as expected across different web browsers.

What happens if I mistakenly use HTML 4.01 <!DOCTYPE> in an HTML5 document?

If you mistakenly use an HTML 4.01 `<!DOCTYPE>` in an HTML5 document, the browser might render the page using HTML 4.01 standards, which could lead to unexpected layout and functionality issues, because some HTML5 elements and attributes will not be recognized correctly.

Can the <!DOCTYPE> declaration affect the way CSS is applied to an HTML document?

Yes, the `<!DOCTYPE>` declaration can affect the way cascading style sheets (CSS) are applied to an HTML (hypertext markup language) document. If the declaration is missing or incorrect, the browser may enter quirks mode, which alters how CSS is interpreted and applied, leading to potential inconsistencies in styling across different browsers.

Does the position of the <!DOCTYPE> declaration matter in an HTML document?

Yes, the position of the `<!DOCTYPE>` declaration is important. It must appear at the beginning of the HTML document, before the `<html>` tag. Placing it anywhere else can cause rendering problems, as the browser needs to know which standards to use before it starts parsing the rest of the document.

Can I use <!DOCTYPE> with other document types like XML?

<!DOCTYPE> is primarily used with HTML documents. XML documents can also use a <!DOCTYPE> declaration, but it is different and serves a different purpose, for defining document structure and rules. Stick to the appropriate declaration for each document type.

What kind of errors could I encounter if the <!DOCTYPE> declaration is missing from my HTML document?

If the `<!DOCTYPE>` declaration is missing from your HTML (hypertext markup language) document. You might encounter various layout and styling inconsistencies across different browsers. Your page might be displayed in quirks mode, leading to unpredictable behaviors and aesthetics, such as incorrect box models, misinterpreted CSS, and layout issues.

Can changing the <!DOCTYPE> declaration in an existing document cause any issues?

Changing the `<!DOCTYPE>` declaration in an existing document can cause issues if the content and CSS were originally designed with a different HTML (hypertext markup language) version in mind. The new DOCTYPE could enforce standards that lead to layout and styling changes, potentially breaking the intended design of the page.

How can <!DOCTYPE> impact the SEO of my web page?

Using the proper `<!DOCTYPE>` declaration helps ensure your web page is rendered consistently across different browsers, which can improve the user experience. This consistency, in turn, can positively impact your search engine optimization (SEO). Search engines favor well-structured and error-free websites that provide a good user experience.

What is the difference between HTML standards mode and quirks mode?

HTML standards mode is a browser's mode of interpreting and rendering web pages using the current web standards as defined by the W3C. Quirks mode, on the other hand, causes the browser to mimic the behavior of older, non-standard-compliant browsers. This mode is usually triggered when the `<!DOCTYPE>` declaration is absent or incorrect.

Does <!DOCTYPE> have any role in responsive web design?

While `<!DOCTYPE>` itself does not dictate responsive web design features, declaring the document as HTML5 with `<!DOCTYPE html>` ensures that modern HTML and CSS code, including responsive design techniques like media queries, are correctly interpreted and rendered by the browser.

How do I choose the right <!DOCTYPE> for my HTML document?

For most modern web pages, using `<!DOCTYPE html>` is the right choice, as it declares the document as HTML5, the latest standard that supports all modern web technologies, including CSS3 and JavaScript. There is no need to use older DOCTYPEs unless you specifically need to support a legacy document type.

Can I include the <!DOCTYPE> improve website loading speed?

While including the `<!DOCTYPE>` will not directly improve website loading speed, it ensures the browser renders the page in standards mode, which can reduce rendering quirks that could potentially slow down page rendering. It ensures a smoother and more efficient parsing process by the browser.

What do I need to know about <!DOCTYPE> when converting a document from XHTML to HTML5?

When converting a document from extensible hypertext markup language (XHTML) to HTML5, you need to replace any XHTML DOCTYPE declaration (which includes a reference to a DTD) with the HTML5 `<!DOCTYPE>` declaration (`<!DOCTYPE html>`). This change is crucial to ensure that the browser understands that the document should be interpreted according to HTML5 standards, which are more flexible and permissive than XHTML.

Looking for a Great Deal?
Shop Lenovo.com for great deals on A+ Education PCs, Accessories, Bundles and more.
Shop Deals Now

  • ThinkPad X9 15 Aura Edition (15ʺ Intel) Laptop
    Starting at
    $1,720.40
    Learn More
  • Yoga 9i 2-in-1 Aura Edition (14″ Intel) Laptop
    Starting at
    $1,736.99
    Learn More
  • IdeaPad Pro 5 (16” AMD) Laptop
    Starting at
    $989.99
    Learn More
  • ThinkPad P1 Gen 7 (16″ Intel) Mobile Workstation
    Starting at
    $2,862.67
    Learn More
  • Lenovo Slim 7i Aura Edition (14” Intel) Laptop
    Starting at
    $1,108.79
    Learn More
  • Shop
    • Student Deals
    • K-12 Student Laptops
    • Student Accessories
    • Laptops by Major
    Education resource
    Explore
    • What is STEM?
    • Best Laptops for College
    • Student & Teacher Discounts
    • Lenovo Sustainability Programs
    Education carry case

    Stem Articles
    See All STEM Articles
    • Online STEM Education

    • STEM Career Tips & Resources

    • Women in STEM

    • STEM Educator Training

    • STEM Grants & Funding

    • STEM Education: Coding for Kids

    • STEM Education: Robotics

    • STEM Education: Biotechnology

    • STEM Education: Sustainability

    • STEM Education: AI & ML

    While every effort has been made to ensure accuracy, this glossary is provided for reference purposes only and may contain errors or inaccuracies. It serves as a general resource for understanding commonly used terms and concepts. For precise information or assistance regarding our products, we recommend visiting our dedicated support site, where our team is readily available to address any questions or concerns you may have.

    Why Lenovo?

    Go Greener with Leno...

    Lenovo is committed to Smarter Climate Action with lower energy laptops, use of sustainable materials and packaging, and available CO2 Offset Services.
    Learn More
    pastel background

    Get It Now, Pay For ...

    Lenovo has multiple financing option: the Lenovo Credit Card, installment plans, and lease-to-own financing op...
    Learn More
    pastel background

    Productivity & Peace of Mind

    Stay productive with Premium Care Plus - 24/7 priority support and coverage against accidental damage. Power through your day with our Smart Performance and extended battery solutions.
    Learn More
    pastel background

    My Lenovo Rewards

    Get up to 9% back in Rewards credit on all purchases! Join or Sign In to start earning today.
    Learn More
    pastel background

    Assistance and Suppo...

    Chat with a trained professional who can help you find the right products, place or check on an order, or setup your Education laptop.
    Contact Us
    pastel background
    Enter email to receive Lenovo marketing and promotional emails. Review our Privacy Statement for more details.
    Please enter the correct email address!
    Email address is required
    • Facebook
    • Twitter
    • Youtube
    • Pinterest
    • TikTok
    • instagram
    Select Country / Region:
    Country
    AndroidIOS

    About Lenovo

    • Our Company
    • News
    • Investors Relations
    • Compliance
    • ESG
    • Product Recycling
    • Product Security
    • Product Recalls
    • Executive Briefing Center
    • Lenovo Cares
    • Careers
    • Formula 1 Partnership

    Products & Services

    • Laptops & Ultrabooks
    • Smarter AI for You
    • Desktop Computers
    • Workstations
    • Gaming
    • Tablets & Smart Devices
    • Servers, Storage, & Networking
    • Accessories & Software
    • Services & Warranty
    • Product FAQs
    • Deals
    • Lenovo Coupons
    • Preconfigured Products

    Shop By Industry

    • Small Business Solutions
    • Large Enterprise Solutions
    • Healthcare Solutions
    • Higher Education Solutions
    • Education Discounts
    • Discount Programs

    Resources

    • Lenovo Pro for Business
    • My Lenovo Rewards
    • Lenovo Financing
    • Customer Discounts
    • Affiliate Program
    • Affinity Program
    • Employee Purchase Program
    • Lenovo Partner Hub
    • Laptop Buying Guide
    • Where to Buy
    • Glossary

    Customer Support

    • Contact Us
    • Shopping Help
    • Return Policy
    • Shipping Information
    • Track my Order
    • Register a Product
    • Replacement Parts
    • Technical Support
    • Forums
    • Provide Feedback
    © 2025 Lenovo. All rights reserved.
    PrivacySite MapTerms of UseExternal Submission PolicySales terms and conditionsAnti-Slavery and Human Trafficking Statement
    Compare  ()
    x
    Call

    Need Help? Call: 

    1-855-253-6686 Option #2
    Select Your Store
    Add items to your cart?
    We've noticed that you've entered a different store. Do you want to add these items to your cart in the new store?
    No Yes. Add in Lenovo Pro