HTML (HyperText Markup Language) is the foundation of any web page. Learn the essential structure of an HTML document and how to create basic elements.
HTML documents have a standard structure that all browsers recognize:
Understanding this structure is crucial:
CSS (Cascading Style Sheets) brings your HTML to life with colors, layout, and design elements.
There are three ways to include CSS in your HTML documents:
Inline CSS is applied directly to HTML elements using the style
attribute:
While convenient for small changes, inline styles can become hard to manage for larger projects.
Internal CSS is defined within the <style>
tag in the document's <head>
section:
This method is good for styling a single page.
External CSS is stored in a separate .css file and linked to the HTML document:
This is the preferred method for larger websites as it keeps your HTML and CSS separate, making maintenance easier.
Forms allow users to interact with your website by submitting data.
Forms collect user input through various form controls:
Tip: Always use the <label>
element with form controls to improve accessibility. The for
attribute of the label should match the id
of the form control.
Learn how to use CSS to create responsive layouts and position elements on your page.
Every HTML element is a box with content, padding, border, and margin:
Understanding the box model is essential for controlling layout and spacing.
Create a simple HTML page with a heading, paragraph, and an image. Then style it using CSS to change colors, font sizes, and add some margins and padding. This hands-on practice will reinforce what you've learned in this module.
Remember to check your work in a browser to see how different CSS properties affect your page's appearance!