Users of the Sitecore CMS should have at least a rudimentary understanding of HTML coding. This will help you to spot problems in the code, which would otherwise mar your beautiful website.
One of the best tutorials is provided by W3Schools.com. If you don’t already know HTML, I recommend that you go through the entire tutorial. However, the most important items to know are the following:
- Introduction
- Basic
- Elements
- Attributes
- Headings
In the main content column on our websites, we use <h2> and <h3> headings only; <h1> is reserved for the page title. - Paragraphs
- Formatting
On our websites, we use <strong> for bold text and <em> for italic text; please do not use <b> and <i>. - Links
Please do not use thetarget="_blank"
attribute in your links, even though Sitecore suggests it; this is considered poor coding. - Images
Image elements must always be closed with a closing /. For more information, see the relevant paragraph in XHTML. - Lists
- Blocks
- Quick List
- HTML Examples
- XHTML
The last item above, “XHTML,” is very important. If you want to make sure that your web pages are rendered correctly by people’s browsers, your HTML code should conform to XHTML standards.
The following tutorials are also highly recommended:
Before adding texts to the main content field on your website pages, please clean the HTML so that it is “basic” and does not have extraneous code. For this, I recommend using HTMLtidy.net.
HTML tags for the content column
The following is a list of tags that are acceptable to be used in the main content column on our websites; please refrain from using others (if in doubt, please consult with the web manager):
- <p> – paragraph
- <h2> and <h3> – headings; do not use <h1>, which is reserved for the page title; lower-level subheadings are not configured, so please do not use them in the main content column
- <strong> – bold text; please do not use <b>
- <em> – italic text; please do not use <i>
- <a href …> – link to an external URL or an internal bookmark/anchor
- <a id …> <h2 id …> – use the “id” attribute to create internal bookmarks/anchors; do not use <a name …>, since it is not supported in the HTML5 specification, which is what we use on our websites
- <br /> – line break within a paragraph; make sure that the <br /> tag is properly closed with a cosing /
- <ul> and <li> – unordered (bullet) list
- <ol> and <li> – ordered (numbered) list
- <blockquote> – block quote
- <img … /> – image; make sure that the <img … /> tag is properly closed with a closing /
- <div> – generic block element
- <span> – generic inline element
- <table>, <th>, <tr>, <td> and other table-related tags
- <iframe> – inline frame; useful for embedding outside documents like YouTube videos
Email if you have any questions.