Javatpoint Logo

91-9990449935

 0120-4256464

Javatpoint Logo

SASS Example

We can simply create SASS and SCSS example. To do so, use the following steps:

Create a HTML file having the following code:

See this example:

Now create a file named "style.scss". It is similar to CSS file. The only one difference is that it is saved with ".scss" extension. Put the both file inside the root folder.

Now, execute the following code: sass --watch style.scss:style.css

SASS Instasll10

It will create a new CSS file named "style.css" inside the root folder automatically. Whenever you change the SCSS file, the style.css file will changed automatically.

The style.css file has the following code:

SASS Instasll11

Now execute the HTML file. It will read the CSS file and the output would be like this:

Output:

SASS Instasll12
Next TopicSass Syntax




Share this page

facebook twitter google plus pinterest tumbler

Latest 4 Tutorials