问题
I'm new to Prestashop. I want to override the CSS file of a module, say blockpermanentlinks
.
The official documentation says that I have to put the new CSS file in
/themes/my_theme/css/modules/my_module/my_module.css
.
It doesn't work. The line
<link href="/prestashop/themes/my_theme/css/modules/blockpermanentlinks/blockpermanentlinks.css" rel="stylesheet" type="text/css" media="all" />
is produced but if I visit that CSS file with my browser a 'Page not found' is displayed.
Any hints?
回答1:
Seems like you've answered your own question. The instructions were to put your CSS file in
/themes/my_theme/...
and you've linked to it at
/prestashop/themes/my_theme/...
Try
<link href="/themes/my_theme/css/modules/blockpermanentlinks/blockpermanentlinks.css" rel="stylesheet" type="text/css" media="all" />
It's hard to say anything more without a link to your site.
回答2:
You can override the CSS file of a module:
go to /themes/{your_theme}/blockpermanentlinks/css/blockpermanentlinks.css
回答3:
Try this path:
/themes/my_theme/css/modules/blockpermanentlinks/blockpermanentlinks.css
delete /cache/class_index.php and make sure to turn on the option from admin as Force Compilation, I hope this will solve your issue.
回答4:
if you need to override only some selectors/properties you can create a custom.css file in:
/themes/my_theme/css/autoload/custom.css
instead of override the entire css file
来源:https://stackoverflow.com/questions/15343000/prestashop-modules-css-override