Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST

HTML and CSS Tutorial


Learn HTML & CSS Together

HTML gives your page structure and CSS makes it look great.

This tutorial guides you through both, step by step.

Follow the integrated track to build webpages that are structured, responsive, and beautiful.

Start learning now »

Practice as you go

Every chapter comes with editable examples and exercises so you can test the HTML markup and CSS styling together.


Example

Render a basic card with HTML and CSS:

HTML + CSS Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body>
<section>
  <h1>Welcome!</h1>
  <p>This card mixes HTML structure with CSS styling.</p>
  <button>Learn more</button>
</section>
</body>
</html>
body {
  font-family: Arial, sans-serif;
  background-color: #f3f6f9;
  margin: 0;
}
section {
  max-width: 500px;
  margin: 60px auto;
  background: white;
  padding: 24px;
  border-radius: 6px;
}
h1 {
  color: #04AA6D;
}
button {
  background:#04AA6D;
  color:white;
  border:none;
  padding:10px 18px;
  border-radius:4px;
}
Try it Yourself »

Click on the "Try it Yourself" button to see how HTML and CSS work together.



Keep exploring

Ready for more focused study?

Check out the standalone tutorials:

HTML Tutorial CSS Tutorial

This integrated tutorial combines the best of both worlds so you can build real web projects faster.


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.