Introduction to CSS - Inline, Internal & External Styles

image of blog Mukesh Saini

HubSpot CMS Developer

1 Minutes Read

Listen to the Blog

Introduction to CSS - Inline, Internal & External Styles
1:01

Style your HTML with CSS using different methods to control colors, fonts, layouts, and more.

What Is CSS?

CSS (Cascading Style Sheets) separates content (HTML) from presentation (styles).

  • Control color, font, spacing, layout, and responsiveness
  • Apply styles globally or to specific elements

Inline CSS

Applied directly to the HTML elementdirectly to the HTML element using the style attribute

This is a blue paragraph.

Internal CSS

Added inside the <head> using the <style> tag

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Internal CSS Example</title>
  <style>
    p {
      color: green;
      font-size: 16px;
    }
  </style>
</head>
<body>
  <p>This paragraph is styled with internal CSS.</p>
</body>
</html>
  • Good for single-page projects
  • Not reusable across multiple pages

External CSS

Stored in a separate .css file and linked with <link>

styles.css

p { color: red; font-size: 20px; }

index.html

<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <p>This paragraph is styled with external CSS.</p>
</body>
  • Best practice for larger websites
  • Makes maintenance easier and reusable across multiple pages

Comparison Table

Method Syntax Location Pros Cons

Inline

Inside HTML element

Quick, overrides other styles

Hard to maintain, not reusable

Internal

<style> in <head>

Good for single-page styling

Not reusable across pages

External

Separate .css file

Reusable, maintainable

Extra HTTP request

I'm Mukesh Saini, a seasoned HubSpot CMS Developer specializing in custom templates, seamless integrations, and high-performing digital experiences. Having honed his skills over several years in the industry, i possess a deep understanding of HubSpot's capabilities.

HubSpot CMS Developer

Frequently Asked Questions

Which CSS method should I use for large websites? +
External CSS is the best for scalability and maintenance.
Can inline CSS override external CSS? +
Yes! inline CSS has the highest specificity.
Can I mix internal and external CSS? +
Yes! but external CSS is loaded first, internal can override, and inline overrides both.
Is internal CSS SEO-friendly? +
Yes! but external CSS is preferred for faster loading and better performance.
cm-vector

Have a specific need or challenge in mind? Let’s discuss how we can support your goals.

Get Started Today

Ready to streamline your Hubspot CRM, website, or RevOps !