Everything seems fine apart from the banner section which appears on various pages which looks like...

enter image description here

I can see that some styles are available in the install at <install_dir>/pub/media/styles.css but this file isn't included in the generated markup so it's not calling a 404.


Step 1 : open the terminal and navigate to magento web root

cd /var/www/html/magento2

Step 2 : Deploy command

php bin/magento s:s:d

Step 3 : Reindex command

php bin/magento i:rei

Step 4 : Set owner command

chown -R www-data:www-data /var/www/html/magento2

Step 5 : Give permission command

chmod -R 777 /var/www/html/magento2

Step 6 : Remove cache command

rm -rf var/cache

You need to enable the apache server rewrite

sudo a2enmod rewrite

You need to restart the web server now to apply the changes:

sudo service apache2 restart

  • Thanks Rohan but no joy. I tried all these steps and had tried them before in various orders. Do you know where I would find the relevant piece of code which states that this code should be added into <head>. Is it in a layout somewhere? – Zakalwe Jun 23 '18 at 19:15
  • Yes. You can find in layout. – Rohan Hapani Jun 24 '18 at 5:04
  • Could you point me in the right direction? Just trying to get to grips with Magento so this would be a good first port of call to understand how Magento inserts and manages css. – Zakalwe Jun 24 '18 at 11:31

Quick Solution

You can copy manually below css code and add it your theme.

enter image description here

<link rel="stylesheet" type="text/css"  media="all" href="{{MEDIA_URL}}styles.css" />

Also check your Magento folder and check for the styles.css file in the pub/media folder. If this file was present then give the pub folder the required rwx permission.

Than run CLI

php bin/magento c:f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.