Coding Instructions for the National Library of Medicine's Main Website
General Guidelines
Developers should endeavor to follow the guidelines specified on these pages:
Additional Guidelines Based on Specific Circumstances
- Package Information for developers whose pages don't live on the NLM main website - NLM Header and Footer
- Minimum Specifications for developers whose non-templated pages live on the NLM main website, but don't resemble the NLM main templated pages
- Specifications for developers whose non-templated pages live on the NLM main website and want their pages to resemble the NLM Main template pages - NLM Header and Footer
Package Information for developers whose pages don't live on the NLM main website - NLM Header and Footer
- NLM Header/Footer code package information - U.S. Web Design System (USWDS). See https://www.nlm.nih.gov/nlmheaderfooter/uswds-2.12.1.zip
- NLM Header/Footer code package information - Bootstrap. See https://www.nlm.nih.gov/nlmheaderfooter/bootstrap.zip
Mininum specifications for developers whose non-templated pages live on the NLM main website, but don't resemble the NLM main templated pages
Document Type Declaration and Language Attribute
- Item: <!DOCTYPE>
- Required?: Yes
- Location?: Very first thing in your HTML document, before the <html lang="en"> tag
- Why needed?: Ensures all pages use the HTML5 Document Type.
- Code:
<!DOCTYPE>
- Item: <html lang="en">
- Required?: Yes
- Location?: Immediately after the tag
- Why needed?: Accessibility - More information at Item 10A on the Web Sites, Web Applications & Software checklist [Excel] which is linked from the HHS Accessibility Compliance Checklists page.
- Code:
<html lang="en">
Meta Tags
- Item: meta-name viewport tag
- Required?: Yes
- Location?: Before the ending </head> tag
- Why needed?: Ensures that the browser will scale to the specified viewport
- Code:
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- Item: meta-http-equiv tags
- Required?: Yes
- Location?: After opening <html> tag
- Why needed?: Ensures Proper Encoding
- Code:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- Displays the webpage in EdgeHTML mode, which is the highest standards mode supported by Internet Explorer, from Internet Explorer 6 through IE11.
- Displays the webpage in EdgeHTML mode, which is the highest standards mode supported by Internet Explorer, from Internet Explorer 6 through IE11.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- Specifies the character encoding for the document.
- Specifies the character encoding for the document.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
- Displays the webpage in EdgeHTML mode, which is the highest standards mode supported by Internet Explorer, from Internet Explorer 6 through IE11 and Chrome Frame.
- Item: Contact email address tag
- Required?: No, but strongly recommended
- Location?: Before the ending </head> tag
- Why needed?: Allows the NLM broken link checker to send a broken link report to the email address.
- Code:
<meta name="NLM.Contact.Email" content="EMAIL_ADDRESS@something_something.nih.gov" />
Google Tag Manager
- Item: Google Tag Manager
- Required?: No, but encouraged
- Location: First entry in the <body> tag
- Why needed: Used to gather more reliable page usage statistics
- Code: Contact NLM for information about this code.
Skip Navigation
- Item:
- Required?: Yes
- Location: Immediately after the Google Tag Manager Code
- Why Needed?: Gives users ability to tab directly to page content .
- Code:
<a class="sr-only sr-only-focusable" href="#skip" title="Skip the navigation on this page">Skip Navigation Bar</a>
HTML <body> tag element
- Required? Yes
- Location: Immediately after </head> tag.
- Why Needed?: Required for all HTML files.
- Code.
<body>
Specifications for developers whose non-templated pages live on the NLM main website and want their pages to resemble the NLM main templated pages - NLM Header and Footer
- Use the information linked from README - Sample code for developers whose non-templated pages live on the NLM main website and want their pages to resemble the NLM main templated pages as a foundation for your pages.
- The README page refers to a file which:
- Contains in the items listed in the Mininum Specifications section above.
- Will give your page the header and footer code needed to be consistent with NLM main templated pages.
- Will update your page with the emergency banner when banner is turned on for all NLM Main templated pages.
- NLM staff make an effort to keep the The README page and the files it references consistent with current NLM Main template specifications.
Last Reviewed: March 15, 2023