How to Add CSS to HTML: Understanding Inline, Internal & External CSS

Written by: Jamie Juviler
Developer checklist graphic featuring a smiling young man with a short beard in a black shirt, surrounded by coding symbols and references to HTML and C++. The title highlights tips for landing a developer role in AI.

HOW TO LAND A DEVELOPER ROLE

A free checklist to help you stand out from human and AI competition and land a developer job.

Download Now
person adding html to css on a laptop

Updated:

If you’re building a website, HTML is your best friend — you can create all of your page content, including headings, paragraphs, images, tables, forms, lists, and so on.

The problem? HTML doesn‘t look good by itself — or at least not in my opinion. That’s why we have CSS.

CSS determines how the things on a web page look when shown in the browser, from font size to colors to shaping the layout of your entire page.

Download Now: How to Land a Developer Role in  the World of AI [Free Checklist]

HTML and CSS go hand in hand, but it’s up to you to decide how to join them. Having worked with these languages for almost a decade at this point, I figured I could give some pointers here. So, let's learn how to add CSS to your HTML.

Table of Contents


How to Add CSS to HTML

CSS affects how HTML content looks on a page. But, in order for this to happen, the browser processing the HTML file needs to know what CSS code should be applied. There are three ways to do this:

  • Inline CSS is written inside an HTML tag with the style attribute. Inline CSS affects only the element of the tag (and possible child elements depending on the property that’s applied).
  • Internal CSS is written inside a

      Download Free

      All fields are required.

    You're all set!

    Click this link to access this resource at any time.

    Then, I’ll add tags to the section of the HTML document. Inside the

      Download Free

      All fields are required.

      You're all set!

      Click this link to access this resource at any time.

      Topics: HTML

      Related Articles

      A free checklist to help you stand out from human and AI competition and land a developer job.

        CMS Hub is flexible for marketers, powerful for developers, and gives customers a personalized, secure experience

        START FREE OR GET A DEMO