<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg" -->

---
title: Astro Crash Course #4 - Styles | daily.dev
description: A beginner tutorial on adding styles to an Astro project. Covers multiple approaches including inline style tags, external stylesheets, and Tailwind, then...
canonical: https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Astro Crash Course #4 - Styles | daily.dev
og:description: A beginner tutorial on adding styles to an Astro project. Covers multiple approaches including inline style tags, external stylesheets, and Tailwind, then...
og:url: https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg
og:image: https://api.daily.dev/og/posts/2Vh1WVyLG.png
og:image:alt: Astro Crash Course #4 - Styles
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Astro Crash Course #4 - Styles

**[Net Ninja](https://daily.dev/sources/netninja)** · 8 min read · 3 upvotes · 0 comments

## Summary

A beginner tutorial on adding styles to an Astro project. Covers multiple approaches including inline style tags, external stylesheets, and Tailwind, then focuses on component-scoped styles. Explains how Astro scopes styles by default using data attributes, how to override this with the `is:global` directive for site-wide styles, and how to mix scoped and global styles within a layout component. Ends with a practical example applying both global and page-specific styles across a multi-page site.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=yDx7ActarLk>

## Similar posts on daily.dev

- [Enhancing Astro With a Markdown Component](https://daily.dev/posts/enhancing-astro-with-a-markdown-component-rnnhd40nz) · CSS-Tricks · 1 upvotes · 0 comments
- [Styles in Eleventy \(Again\)](https://daily.dev/posts/styles-in-eleventy-again--ldo8helev) · Kitty says hi. · 5 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#tailwind-css](https://daily.dev/tags/tailwind-css), [#astro](https://daily.dev/tags/astro)

[View this post on daily.dev](https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Astro Crash Course #4 - Styles","url":"https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg"},"datePublished":"2026-03-30T09:04:37.511Z","dateModified":"2026-03-30T09:04:55.564Z","description":"A beginner tutorial on adding styles to an Astro project. Covers multiple approaches including inline style tags, external stylesheets, and Tailwind, then...","image":"https://i.ytimg.com/vi/yDx7ActarLk/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/yDx7ActarLk/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Net Ninja","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Net Ninja","logo":"https://media.daily.dev/image/upload/s--IXsAE5jo--/f_auto/v1718348103/logos/netninja","url":"https://daily.dev/sources/netninja"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/astro-crash-course-4---styles-2vh1wvylg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,tailwind-css,astro","timeRequired":"PT8M","video":{"@type":"VideoObject","name":"Astro Crash Course #4 - Styles","description":"A beginner tutorial on adding styles to an Astro project. Covers multiple approaches including inline style tags, external stylesheets, and Tailwind, then...","thumbnailUrl":"https://i.ytimg.com/vi/yDx7ActarLk/sddefault.jpg","uploadDate":"2026-03-30T09:04:37.511Z","duration":"PT8M","url":"https://api.daily.dev/r/2Vh1WVyLG","embedUrl":"https://www.youtube.com/embed/yDx7ActarLk"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Net Ninja","item":"https://daily.dev/sources/netninja"},{"@type":"ListItem","position":3,"name":"Astro Crash Course #4 - Styles"}]}
```

