What DOCTYPE do i need to use this script?

go on this link to find it:

http://www.dynamicdrive.com/style/csslibrary/item/suckertree-menu-horizontal/P30/

Thanks!

Max

Dani AI

Generated

asked which DOCTYPE to use for the Dynamic Drive "SuckerTree" menu. and correctly noted the demo page was authored as XHTML, and reasonably suggested contacting the author if uncertain. Below is a concise, practical approach that reflects current best practice and keeps compatibility with older example pages.

Prefer the HTML5 doctype for new pages because it is simple and consistently triggers standards mode across modern browsers. Use:
<!DOCTYPE html>
This is the recommended starting point; authoritative background is on the MDN glossary and the HTML Living Standard (MDN Doctype, HTML Living Standard).

Quick checklist to get the menu working reliably:

  • Build a minimal test page with <!DOCTYPE html> and the menu markup/CSS/JS included. Place the menu script with defer or just before </body> so it runs after the DOM is available.
  • Validate your page (use the W3C validator) to catch stray tags or broken structure that can break layout or script behavior.
  • If the menu fails under HTML5, compare your markup to the demo and, as a fallback, match the demo page's doctype exactly for a 1:1 environment.
  • Note: pages served as XML (application/xhtml+xml) are parsed differently than HTML; only use that delivery if you need strict XML parsing.

This approach gives a forward-compatible default (<!DOCTYPE html>) while providing practical steps to reproduce the demo environment if required.

Recommended Answers

All 4 Replies

I would suggest that you ask the author of the script.

i would but nobody is answering anything lol. thanks anyway

Member Avatar for Member #114696

Well i saw the source code of the page(the link you've given) in which the menu was inserted and they use XHTML Transitional, so u could use XHTML Transitional since it was working properly in that page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Hi there,

I have seen the code and there is not anything that force to choose the specific doctype, but this tag "<br style="clear: left;" />" shows that its XHTML,

You can use this doctype

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Or

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Well, hope this will help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.