Blog

Learn HTML and CSS for beginners

How HTML, CSS and JavaScript differ, the tools you need, your first page step by step, Arabic and right-to-left support, and publishing your site for free.

In shortLearn HTML and CSS from zero: free places to learn, your first page step by step, right-to-left Arabic sites, free publishing and three starter projects.
Learn HTML and CSS for beginners

Learn HTML and CSS and you will see your work on screen within the first hour. HTML is a markup language that builds a page's content: headings, paragraphs, images and links. CSS is a style sheet language that decides how that content looks: colours, fonts, spacing and layout. Neither is a programming language in the full sense, which is exactly why they make an easy start. Once you have them down, JavaScript adds interactivity.

The trio behind every website

LanguageIts jobExample
HTMLThe structure and meaning of contentA heading, a paragraph, an image, a list, a link
CSSHow content looks and is laid outText colour, heading size, items side by side
JavaScriptInteraction and behaviourA button that opens a menu, a form that checks input
Comparison card of the guide table

Where to learn for free

  • MDN's Learn web development: a structured set of tutorials from Mozilla that teaches the essentials of front-end development, with challenges and further resources. It starts with a "Your first website" module, then HTML, CSS basics, layout and JavaScript.
  • Satr: in Arabic and completely free, and its FAQ lists HTML, CSS and JavaScript among its web development courses.
  • For the bigger picture of programming before you choose, read how to learn programming from zero.

What you need

MDN says you should be comfortable with your operating system, the file system and browsing the web, and have a code editor and several browsers installed. So an ordinary laptop is enough, plus a free code editor and two browsers, such as Chrome and Firefox, to check your site looks right in both.

Your first page, step by step

  1. Make a folder

    Create a folder called my-site with a file called index.html inside. That is the name of the home page on most websites.

  2. Write the skeleton

    Open the file in your editor and write the basic HTML structure: an html tag containing head and body. Put the page title in head and your content in body.

  3. Add content

    Write an h1 heading with your name, a p paragraph introducing yourself, a ul list of your skills, and an a link to your LinkedIn.

  4. Open it in a browser

    Drag the file into your browser and look at the result. Every time you edit and save, refresh.

  5. Add CSS

    Create style.css in the same folder and link it from head with a link tag. Try a rule that turns paragraphs red. If the text turns red, your CSS is working.

  6. Style it

    Change the font, colours and spacing, and centre the content at a comfortable reading width.

5-step flow: Make a folder / Write the skeleton / Add content / Open it in a browser / Add CSS

An Arabic site? Make it right to left

If your page is in Arabic, add lang="ar" and dir="rtl" to the html tag. The first tells browsers and screen readers the language is Arabic, and the second sets the direction to right to left. If your site is bilingual, give each language its own page with its own attributes. In CSS, use properties like margin-inline-start instead of margin-left, so your layout flips correctly between Arabic and English.

Habits that keep your code tidy from day one

  • Use tags for their meaning: one h1 for the main title, h2 for sections, p for paragraphs and button for buttons. It helps screen readers and search engines.
  • Give every image alt text that describes it, because someone who cannot see the image hears the description.
  • Keep all styling in your CSS file, not inside HTML tags.
  • Name classes after what they do, such as card or site-header, not after colours.
  • Test your page at phone width in your browser's developer tools, because most people will open it on their phone.

Publish your site for free

GitHub Pages is a static site hosting service: it takes HTML, CSS and JavaScript files from a GitHub repository and publishes them as a website at an address like yourname.github.io. It is available for public repositories on the free plan. Upload your my-site folder to a repository and turn on Pages in the repository settings. If you are new to GitHub, start with GitHub for beginners.

Three projects to build your skills

  • A page about you: your name, major, skills and links. It becomes the core of your portfolio.
  • A page for a student club or an event at your university: title, description, date and a sign-up button.
  • A copy of a page you like: pick a simple page and rebuild it from scratch without looking at its code. It is the best layout exercise there is.

When you want feedback on your code, use this template with any AI assistant:

HTML and CSS review
I am learning HTML and CSS. Here is my page's code: [paste HTML and CSS]. Review it like a teacher: tell me three things I did well and three things to improve in structure, styling and accessibility, with one sentence on why for each. Do not rewrite the whole page, I want to fix it myself.

After HTML and CSS

The natural next step is to learn JavaScript so you can add interactivity. If you enjoy the look and experience side more than code, see learn UI and UX design. Design tools like Figma and Canva have student offers, covered in free software for university students.

  • GitHub: GitHub offers GitHub Student Developer Pack to university students in Saudi Arabia for free.
  • Figma: Figma offers Figma for Education to university students in Saudi Arabia for free.
  • Canva: Canva offers Canva Pro free through Canva for Campus to university students in Saudi Arabia.

Questions

Are HTML and CSS programming languages?

Not in the full sense. HTML is a markup language that builds content, and CSS is a style sheet language that decides how it looks. Programming logic and interaction come with JavaScript.

Where can I learn HTML and CSS for free?

MDN's Learn web development from Mozilla in English, and Satr from Tuwaiq Academy in Arabic. Both are free.

What do I need to start?

An ordinary laptop, a code editor and more than one browser to check your page displays correctly.

How do I make my site Arabic and right to left?

Add lang="ar" and dir="rtl" to the html tag, and use logical CSS properties such as margin-inline-start.

How do I publish my site for free?

Upload your files to a public GitHub repository and turn on GitHub Pages, and your site goes live on a github.io address.

What should I learn after HTML and CSS?

JavaScript, to add interactivity, and then you can choose between front-end, back-end or design.

Sources

  1. developer.mozilla.org: developer.mozilla.org/en-US/docs/Learn_web_development
  2. developer.mozilla.org: developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website
  3. developer.mozilla.org: developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Creating_the_content
  4. developer.mozilla.org: developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Styling_the_content
  5. docs.github.com: docs.github.com/en/pages/getting-started-with-github-pages/what-is-github-pages
  6. sites.satr.codes: sites.satr.codes/faq?platform=SATR

Hear when tiswa opens.

Join the free waitlist. We notify you at launch; then verify as a student and access the deals under their terms.

  • Free for good
  • No card
  • Takes a minute
Join the waitlist

More articles