0

I created a default.xml file at \app\design\frontend\nitish\Lucowatch\Magento_theme\layout and add the following code

<?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/styles-m.css" />
    <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
    <css src="css/print.css" media="print" />
    <css src="css/bootstrap.min.css" media="print" />
    <css src="css/font_family.css" media="print" />
    <css src="css/mystyle.css" media="print" />
    <css src="css/theme.css" media="print" />
</head>

but I did not find css when I go on home page

3
  • Have you tried clearing caches and deleting var/view_preprocessed and pub/static/frontend?
    – Ben Crook
    Commented Oct 4, 2016 at 12:30
  • media="print" means this stylesheet is only available when printing, remove that and refresh the cache.
    – Devtype
    Commented Oct 4, 2016 at 12:34
  • Yes I did clearing caches many times..but not working after that Commented Oct 4, 2016 at 15:26

2 Answers 2

1

give this a try:

you can find default_head_blocks.xml in your theme at vendor\magento\module-theme\view\frontend\layout
just put inside head tag

<head>
 <css src="css/customcss.css" />
</head> 


after that copy default_head_blocks.xml to your theme.

2
  • welcome Nitish Kumar...
    – Pawan
    Commented Oct 5, 2016 at 12:22
  • If you don't mind can I ask you something again? I did that again. Actually I had to add some more files so after that I did the same process and after that I deploy my content and now my old static css have also gone. I don't know what this happen. and now I'm repeating the same process but after that my static css are not including. Could you help me? Thanks! Commented Oct 6, 2016 at 12:32
0

After adding the css file in head block you have to deploy static content and flush the cache like :

cd /var/www/html/project root directory
sudo bin/magento setup:static-content:deploy
sudo bin/magento cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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