Hi, whenever I go to validate any page I've been creating in Dreamweaver CC (18.2), the first issue I always see is "Consider adding a lang attribute to the html start tag to declare the language of this document." Why isn't that added automatically when I start working on a blank html5 page, and how do I get dreamweaver to add it every time I start on a new html5 page?
Only 20% of the world uses English as a primary language. So how can Adobe or anyone else predict which language you need in your document? Maybe you're building a French language site with translated pages in English, Chinese, German or .....? Only you know which languages you need, right?
TIP: Get into the habit of putting frequently used code fragments into your custom Snippets folder for quick & easy insertion.
This is actually one of the simpler things to fix in DW, if you have Admin rights on your computer...
1. Go to C > Program Files > Adobe > Adobe Dreamweaver (your version) > configuration > Document Types > New Documents
2. Open Default.html
3. Add the code to the <html> tag, something like <html lang="en-us"> [Edited by moderator for accuracy]
NOTE: don't worry that the doctype is wrong, DW automatically changes that when you select HTML5
4. Save the file to your desktop
5. Transfer the file to the path above and overwrite the original (you need Admin rights for this step)
6. Open DW and create a new HTML file, the lang attribute will now be in your <html> tag
I do the above every update, copying and pasting the old version's Default.html to my new version so all of my base info is automatically populated in every new file.
If you use other file types regularly, like .php for example, you'll need to conduct the same addition to the corresponding Default. file.
Also remember that a language attribute is recommended but not required. If represented elsewhere, the XML:LANG has priority. See MDN for details.