- concrete5 Cookbook
- David Strack
- 191字
- 2021-08-13 16:16:01
Including CSS in the block view
Developers and designers working on custom concrete5 block types can have a CSS file automatically included. In this recipe, we will automatically include a CSS file that will change our background to black.
Getting ready
We are still working with the block that was created earlier in the chapter. Please make sure that block exists, or adapt this recipe to suit your own concrete5 environment.
How to do it...
The steps for including CSS in the block view are as follows:
- Open your block's directory.
- Create a new file called
view.css
, if it doesn't exist. - Add a rule to change the background color of the site to black:
body { background: #000 !important; }
- Visit the page containing your block.
- The background should now be black!
How it works...
Just like it does with JavaScript, concrete5 will automatically include view.css
in the page's header if it exists in your block directory. This is a great way to save some time with styles that only apply to your block.
See also
- The Including JavaScript in block forms recipe
- The Including JavaScript in the block view recipe
推薦閱讀
- Google Apps Script for Beginners
- 程序員面試白皮書
- Spring Cloud Alibaba微服務(wù)架構(gòu)設(shè)計(jì)與開發(fā)實(shí)戰(zhàn)
- Oracle從新手到高手
- INSTANT Weka How-to
- Cassandra Data Modeling and Analysis
- Windows Server 2012 Unified Remote Access Planning and Deployment
- Getting Started with Gulp
- SQL基礎(chǔ)教程(第2版)
- Instant Lucene.NET
- TMS320LF240x芯片原理、設(shè)計(jì)及應(yīng)用
- Extending Unity with Editor Scripting
- Java EE 7 with GlassFish 4 Application Server
- Python Web自動(dòng)化測(cè)試設(shè)計(jì)與實(shí)現(xiàn)
- 從零開始學(xué)UI:概念解析、實(shí)戰(zhàn)提高、突破規(guī)則