cancel
Showing results for 
Search instead for 
Did you mean: 

CSS not loading properly

CSS not loading properly

Hi I'm having a bad start off with Magento 2.1.6 running on Xampp.

I'm trying now for 2 days to add a simple CSS to my theme which inherits the Blank Theme.

I created the following file:

<Vendor>/<theme>/Magento_Theme/layout/default_head_blocks.xml

 

with the following content:

 

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="css/myStyle.css"/>
</head>
</page>

 

I have a CSS file under:

<Vendor>/<theme>/web/css/myStyle.css

 

but no matter what I try the file doesn't load and the changes I do in the css file are not shown.

I tried running all grunt commands, clearing cache, deleting pub/static and any other method that was written online but none worked for me.

has anyone had a similar problem and managed to solve it?

1 REPLY 1

Re: CSS not loading properly

What is your store mode? (production, developer)
Did you run deploy static content command?
What errors do you see in your browser console? 404 for css file not found?