Fading Coder

One Final Commit for the Last Sprint

Home > Notes > Content

Core Web Development Concepts: HTML5 and Browser Fundamentals

Notes Nov 4 3

The Role of Web Browsers

Browsers act as the runtime environment for web applications. Their primary responsibility is to parse and render code (HTML, CSS, and JavaScript) into a visual interface that users can interact with. The core of any browser is its rendering engine. Because different browsers—such as Chrome, Firefox, Safari, Edge, and Opera—may use different engines, the speed and visual consistency of a webpage can vary acrosss platforms.

Web Standards: The Three Layers

Modern web development is built upon three distinct layers that separate content from presentation and logic:

  • Structure (HTML): Defines the elements and content of the page.
  • Presentation (CSS): Controls the visual design, including layout, colors, and fonts.
  • Behavior (JavaScript): Manages interactivity and dynamic data processing.

HTML Syntax and Document Structure

HTML (HyperText Markup Language) uses a system of "tags" to describe the structure of a document. Tags are typically enclosed in angle brackets. Most elements consist of a start tag and an end tag (paired tags), while some are self-closing (single tags).

Elements within a document establish relationships:

  • Parenet-Child: When one element is nested inside another.
  • Siblings: Elements that share the same parent and exist at the same level.

Hierarchy with Headings

Heading tags range from <h1> to <h6>, representing levels of importance. They are block-level elements, meaning they occupy the full width of their container and appear in bold by default.

<h1>Main Page Title</h1>
<h2>Section Heading</h2>
<h3>Sub-section Topic</h3>

Text and Layout Elements

For standard text blocks, the <p> (paragraph) tag is used. To handle spacing, developers use <br> for a line break and <hr> to insert a horizontal thematic break.

Text Formatting

While CSS is preferred for styling, HTML provides semantic tags for text emphasis:

Effect Semantic Tag Visual Tag
Bold <strong> <b>
Italic <em> <i>
Underline <ins> <u>
Strikethrough <del> <s>

Multimedia Integration

Images

The <img> tag is a self-closing element used to embed visuals. It relies on attributes to define its behavior:

<img src="assets/logo.png" alt="Company Logo" title="Click to go home" width="200">
  • src: The path to the image file.
  • alt: Alternative text displayed if the image fails to load.
  • title: Tooltip text shown on hover.
  • width/height: Dimensions in pixels. If only one is set, the image scales proportionally.

Audio and Video

HTML5 introduced native support for media files without requiring external plugins.

<!-- Audio Example -->
<audio src="media/podcast.mp3" controls></audio>

<!-- Video Example -->
<video src="media/demo.mp4" controls width="640" muted autoplay loop></video>
Attribute Description
controls Displays play, pause, and volume UI.
autoplay Starts playback automatically (often requires "muted" for video).
loop Restarts the media once finished.

Navigation and Links

Hyperlinks are created using the <a> (anchor) tag. The href attribute specifies the destination URL or file path.

<a href="https://example.com" target="_blank">Visit External Site</a>

The target attribute determines where the link opens:

  • _self (default): Opens in the current tab.
  • _blank: Opens in a new browser tab or window.

Understanding Resource Paths

When linking to images, scripts, or other pages, developers use two types of paths:

  • Absolute Path: The full URL or exact file system location (e.g., https://site.com/image.png).
  • Relative Path: The location relative to the current file.
    • filename.html: Same directory.
    • images/photo.jpg: Down into a subfolder.
    • ../index.html: Up one directory level.

Related Articles

Designing Alertmanager Templates for Prometheus Notifications

How to craft Alertmanager templates to format alert messages, improving clarity and presentation. Alertmanager uses Go’s text/template engine with additional helper functions. Alerting rules referenc...

Deploying a Maven Web Application to Tomcat 9 Using the Tomcat Manager

Tomcat 9 does not provide a dedicated Maven plugin. The Tomcat Manager interface, however, is backward-compatible, so the Tomcat 7 Maven Plugin can be used to deploy to Tomcat 9. This guide shows two...

Skipping Errors in MySQL Asynchronous Replication

When a replica halts because the SQL thread encounters an error, you can resume replication by skipping the problematic event(s). Two common approaches are available. Methods to Skip Errors 1) Skip a...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.