← Community home

HTMLCodeRunner Editorial

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 100 total)
  • Author
    Posts
  • in reply to: What does a robots noindex meta tag do? #145

    Detailed answer

    It asks compliant search engines not to index a page they can fetch.

    The crawler must be able to retrieve the page to read the tag. Use authentication to protect private material because noindex is not access control. Local and staging content should not accidentally become a public search destination.

    Example

    <meta name="robots" content="noindex, nofollow">

    Understanding the behavior

    Noindex asks a crawler that can access the page to exclude it from search results. Blocking the URL in robots.txt can prevent the crawler from seeing that instruction. It is not an access-control mechanism for private data.

    Practical implementation notes

    Inspect both the robots meta tag and any X-Robots-Tag response header. For private material, enforce authentication and authorization on the server; do not rely on a search directive to keep the content confidential.

    How to check it

    Check the returned robots metadata while keeping private data behind authentication.

    Expected result

    A compliant crawler can read noindex; sensitive content still needs access control.

    Watch out: Blocking crawling can prevent a search engine from seeing the noindex tag.

    Read the reference ↗

    in reply to: How do you reference a favicon in HTML? #147

    Detailed answer

    Use a link in head with rel=icon and a suitable image resource.

    Supply the correct type when specifying one. Browsers often cache icons aggressively, so check the resource request before assuming markup is wrong. In WordPress, configuring a Site Icon can manage icon links without manually editing templates.

    Example

    <link rel="icon" href="/favicon.png" type="image/png">

    Understanding the behavior

    A favicon is a small brand identifier used in browser interfaces and potentially search results. Link to a fetchable asset with a suitable format and size. An icon link is metadata, so place it in head rather than the visible body.

    Practical implementation notes

    Open the asset directly and verify it is an image rather than an HTML error response. Browser icon caching can make updates appear delayed even after the page markup has changed.

    How to check it

    Fetch the icon URL directly and check the response before clearing relevant browser cache.

    Expected result

    A valid icon resource is available even if the old tab icon remains cached.

    Watch out: A new icon may not immediately replace a cached browser-tab icon.

    Read the reference ↗

    in reply to: How do you identify alternate language pages? #149

    Detailed answer

    Alternate links with hreflang describe equivalent language versions.

    Each target should contain the indicated language and correspond to the same content. Keep the alternate set consistent across those pages. The links describe translations that exist; they do not translate content or justify pointing all languages to unrelated homepages.

    Example

    <link rel="alternate" hreflang="en" href="https://example.com/en/html/">
    <link rel="alternate" hreflang="hi" href="https://example.com/hi/html/">

    Understanding the behavior

    Hreflang describes alternate versions for languages or regions, while lang describes the language of the current document. Alternate pages should identify themselves and link back consistently. Use actual equivalent pages rather than pointing every locale to a single untranslated page.

    Practical implementation notes

    Check the full set of alternate links on every participating version. Canonicals and language alternates should agree about the intended pages, and every referenced URL should be publicly accessible.

    How to check it

    Check both alternate links and verify the actual content language of each destination.

    Expected result

    Each language target is a matching translation rather than an unrelated page.

    Watch out: Check that every alternate page actually exists in the stated language.

    Read the reference ↗

    in reply to: Can structured data create a rich result on its own? #151

    Detailed answer

    No.

    Structured data must describe visible content accurately and meet the relevant feature's requirements. Appearance is not guaranteed. Keep authors, dates, and claims genuine. Editorial tutorials should not be disguised as independent community activity, and fabricated votes or reviews should never be added to make a page appear more popular.

    Example

    <script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","headline":"HTML labels explained","author":{"@type":"Organization","name":"HTMLCodeRunner Editorial"}}</script>

    Understanding the behavior

    Structured data describes visible content in a machine-readable form. Valid JSON syntax is only one requirement; the selected type and its claims must match the page. Markup does not create reviews, independent users or content that is absent from the page.

    Practical implementation notes

    Use the relevant Google test after deployment and review its warnings in context. Eligibility does not guarantee a rich result, and misleading properties can undermine otherwise technically valid markup.

    How to check it

    Validate structured data and compare every author, date, and claim with visible content.

    Expected result

    The markup describes real editorial content and promises no guaranteed rich result.

    Watch out: Validate the markup and its fit with the actual content.

    Read the reference ↗

    in reply to: How do colspan and rowspan change a table grid? #121

    Detailed answer

    Colspan makes a cell span columns; rowspan makes it span rows.

    Count the grid carefully and preserve understandable header relationships. Merging can express some data structures but may increase navigation complexity. Use it for meaningful data relationships rather than to reproduce a decorative page layout.

    Example

    <table><tr><th colspan="2">HTML reference</th></tr><tr><td>Forms</td><td>Inputs</td></tr></table>

    Understanding the behavior

    Spanning cells occupy several positions in the table grid. Subsequent cells need to account for that occupied space; otherwise the apparent columns can become misaligned. A span should reflect a real data relationship rather than a visual shortcut.

    Practical implementation notes

    Sketch the grid before writing complicated spans. If the table becomes difficult to explain or navigate, consider splitting it into simpler tables with clear captions and fewer merged cells.

    How to check it

    Count the resulting grid positions rather than only the number of tags in each row.

    Expected result

    The merged header covers exactly the intended columns.

    Watch out: Check the effective total number of columns in every row.

    Read the reference ↗

    in reply to: Why use row groups in an HTML table? #123

    Detailed answer

    Thead, tbody, and tfoot identify header, body, and summary groups.

    They make structure and group styling clearer. Browsers may insert tbody into the DOM even when it is absent from source. A selector that assumes tr is a direct child of table can therefore miss the rendered rows.

    Example

    <table><thead><tr><th>Topic</th><th>Count</th></tr></thead><tbody><tr><td>HTML</td><td>10</td></tr></tbody><tfoot><tr><th>Total</th><td>10</td></tr></tfoot></table>

    Understanding the behavior

    Thead, tbody and tfoot group related rows and provide useful structural hooks. They do not replace correct th cells or header associations. Browsers can insert a tbody in the parsed DOM even when the source omits it.

    Practical implementation notes

    When a selector such as table > tr does not match, inspect the parsed tree for an inserted row group. Write CSS and DOM queries against the structure that actually exists.

    How to check it

    Inspect the Elements panel for an inserted tbody and adjust the selector accordingly.

    Expected result

    The selector matches the parsed row group rather than an assumed source structure.

    Watch out: Inspect the parsed DOM before debugging row selectors.

    Read the reference ↗

    in reply to: When is an unordered list appropriate? #125

    Detailed answer

    Use ul when the items form a list but their order is not essential.

    Use ol when sequence matters, such as installation steps. Each item belongs in li. CSS can adjust marker appearance without discarding list structure. A sequence of paragraphs with typed bullet characters is not an equivalent semantic list.

    Example

    <ul><li>HTML reference</li><li>Code examples</li><li>Community questions</li></ul>

    Understanding the behavior

    An unordered list groups items whose sequence is not essential to their meaning. Use an ordered list when changing the order would alter instructions or ranking. Each item belongs in an li rather than in a paragraph separated by bullet characters.

    Practical implementation notes

    Remove the bullet styling mentally and check whether the content is still a set of related items. List markup remains useful even when the design hides the default bullets.

    How to check it

    Reorder two items and check whether the meaning changes.

    Expected result

    If meaning is unchanged, an unordered list is appropriate.

    Watch out: Choose list meaning before choosing marker style.

    Read the reference ↗

    in reply to: How do you continue ordered-list numbering? #127

    Detailed answer

    Start sets an ordered list's initial number.

    An individual li can supply a value when a specific item must restart numbering. Keep the sequence understandable when copied or read aloud. Use real numbering semantics rather than typing a number into each item and manually maintaining the sequence.

    Example

    <ol start="4"><li>Open the HTML file.</li><li>Check the preview.</li><li>Fix errors.</li></ol>

    Understanding the behavior

    An ordered list's start attribute sets its starting ordinal, while an individual li can set a value. These are useful when a sequence continues after explanatory content. Styling alone should not communicate numbering that differs from the real list order.

    Practical implementation notes

    Check the sequence after inserting or removing an item. Hard-coded numbers inside the text can drift out of sync with actual numbering and produce confusing duplicate numbers for assistive technology.

    How to check it

    Set start on the next ordered list and inspect the displayed numbering.

    Expected result

    The continuation begins at 4 without manually typing numbers into item text.

    Watch out: Use ol only when the order conveys useful meaning.

    Read the reference ↗

    in reply to: Where does a nested list belong? #129

    Detailed answer

    Place a nested ul or ol inside the li it describes.

    This connects the sublist to its parent item. Source indentation improves readability but cannot create valid structure by itself. Inspect the rendered nesting when a menu or list looks correct visually but behaves unexpectedly in assistive technology.

    Example

    <ul><li>Forms<ul><li>Labels</li><li>Inputs</li></ul></li><li>Media</li></ul>

    Understanding the behavior

    A nested list belongs inside the parent li whose content it expands. Placing a second list directly between sibling li elements can produce repaired or misleading structure. Indentation in the source does not establish a parent-child relationship.

    Practical implementation notes

    Collapse the sub-list conceptually: the parent item should still read sensibly. Use CSS for indentation and markers after the underlying list hierarchy accurately represents the information.

    How to check it

    Move the sublist inside its owning li and inspect the hierarchy.

    Expected result

    The subtopics belong to their parent item in the parsed tree.

    Watch out: Do not place a sublist directly between sibling list items.

    Read the reference ↗

    in reply to: When should you use dl, dt, and dd? #131

    Detailed answer

    A description list represents terms and associated descriptions, making it useful for a glossary or metadata relationships.

    Dt supplies a term and dd its description. Use a table when the information is better understood as intersecting rows and columns. A two-column visual arrangement alone is not enough reason to choose dl.

    Example

    <dl><dt>HTML</dt><dd>Markup for web content.</dd><dt>Element</dt><dd>A unit of document structure.</dd></dl>

    Understanding the behavior

    A description list associates terms or names with descriptions or values. It suits a glossary or a set of metadata pairs. It is not necessary for every two-column design, especially when the content represents rows in a comparable data table.

    Practical implementation notes

    Check that every dt has the intended associated dd content. More than one term or description can be valid, but the grouping should still be understandable without relying only on visual placement.

    How to check it

    Group each term with its description and read the relationships in order.

    Expected result

    Each dt is associated with the following description content.

    Watch out: Do not use glossary markup solely as a layout shortcut.

    Read the reference ↗

    in reply to: How do you make a wide table usable on a phone? #133

    Detailed answer

    Preserve table semantics and allow horizontal scrolling around a wide table when needed.

    Keep text readable. If the scroll region needs keyboard focus, label it meaningfully and test keyboard access. Reducing columns or offering a simpler summary may serve readers better than forcing a dense desktop table into a narrow screen.

    Example

    <div role="region" aria-label="Lesson comparison" tabindex="0" style="overflow-x:auto"><table><caption>Lessons</caption><tr><th>Topic</th><th>Time</th></tr><tr><td>Forms</td><td>30 minutes</td></tr></table></div>

    Understanding the behavior

    A scrollable wrapper can preserve a real table's relationships on a narrow screen. Avoid hiding essential columns solely to make the table fit. If the scroll area needs keyboard access, provide a visible focus indicator and a clear accessible name.

    Practical implementation notes

    Test at a phone width and with zoom. Readers should be able to reach the final column without making the entire page scroll sideways. Check that long unbroken values do not expand the page container.

    How to check it

    Try horizontal scrolling with both touch and keyboard at a narrow width.

    Expected result

    All columns remain reachable without shrinking the text to an unreadable size.

    Watch out: Do not remove headers without providing equivalent relationships.

    Read the reference ↗

    in reply to: How do you write a useful page title? #135

    Detailed answer

    Describe the specific page and distinguish it from neighboring pages.

    Put title in head and keep the visible heading consistent with the page purpose. A brand can be included where useful. Search engines can choose a different title link, so this is descriptive metadata rather than a display or ranking guarantee.

    Example

    <title>HTML form labels: examples and fixes — HTMLCodeRunner</title>

    Understanding the behavior

    A useful title identifies this specific page and can include a concise site name. It should match the page's main purpose without repeating the same keyword many times. Different pages should not all share an indistinguishable title.

    Practical implementation notes

    Compare several open browser tabs and search previews. Google can generate a different title link, so a well-written title is guidance rather than a promise about the exact search appearance.

    How to check it

    Open two discussions side by side and compare their titles and visible headings.

    Expected result

    Each tab distinguishes its own question and matches its page purpose.

    Watch out: Avoid the same generic title on every discussion.

    Read the reference ↗

    in reply to: How do you embed an accessible audio lesson? #107

    Detailed answer

    Use audio with controls and a supported resource, together with a descriptive heading.

    Provide a transcript so the information is available without playback. Avoid unexpected automatic sound. Native controls help people operate the player, but they do not provide an equivalent of the audio content by themselves.

    Example

    <h2>HTML introduction</h2><audio controls preload="metadata" src="intro.mp3"></audio><p><a href="/intro-transcript/">Read transcript</a></p>

    Understanding the behavior

    An audio element offers playback, but spoken content also needs an accessible text equivalent such as a transcript. The transcript can help people who cannot hear the audio and people who prefer searching or reading the lesson.

    Practical implementation notes

    Check the file response and supported format if playback fails. Avoid making a lesson depend on automatic playback, and ensure the transcript covers the meaningful information rather than only listing the topic.

    How to check it

    Open the transcript without playing the audio and compare its information with the recording.

    Expected result

    The transcript conveys the lesson rather than merely offering a filename.

    Watch out: A transcript should convey the information, not merely name the audio file.

    Read the reference ↗

    in reply to: What does track add to an HTML video? #109

    Detailed answer

    Track associates timed text with media, such as captions or subtitles.

    WebVTT is a commonly used format. Supply a language and meaningful label so viewers can choose a track. Captions include relevant sound information in addition to dialogue. Test the track with actual playback rather than checking only the markup.

    Example

    <video controls src="lesson.mp4"><track kind="captions" src="captions-en.vtt" srclang="en" label="English" default></video>

    Understanding the behavior

    A track can reference timed text such as captions in WebVTT format. The kind, language and label help the browser present the track appropriately. Captions should include meaningful non-speech sounds as well as spoken dialogue.

    Practical implementation notes

    Enable captions in the player and check their timing against the video. Confirm the track file loads successfully; a correctly written track element cannot repair a missing file or inaccurate caption content.

    How to check it

    Check the track URL, WebVTT response, language, label, and selected track during playback.

    Expected result

    The track becomes selectable and captions are synchronized with the media.

    Watch out: Captions and translated subtitles serve related but different needs.

    Read the reference ↗

    in reply to: Should an SVG be inline or embedded as an image? #111

    Detailed answer

    Img works well for a separate SVG asset with alt text.

    Inline SVG allows document styling and scripting but requires appropriate accessibility naming and careful handling. Choose according to the asset's role rather than convenience alone. Uploaded SVG should be treated as active content and sanitized before embedding.

    Example

    <img src="html-tree.svg" alt="The hierarchy of a basic HTML document" width="480" height="320">

    Understanding the behavior

    An external SVG used as an image is convenient for reusable graphics, while inline SVG allows individual shapes to be styled or manipulated in the document. Both approaches still need an accessible treatment suited to the graphic's purpose.

    Practical implementation notes

    Treat SVG from untrusted sources carefully, especially when inserting it inline. For a simple decorative icon next to visible text, avoid adding a duplicate accessible name that makes the label repetitive.

    How to check it

    Load it through img and inspect the accessible name supplied by alt.

    Expected result

    It behaves as an image resource without exposing a custom inline widget.

    Watch out: Do not inject arbitrary uploaded SVG into the document.

    Read the reference ↗

Viewing 15 posts - 46 through 60 (of 100 total)