How to Rip CSS from a .html Template
In case you wanted to rip the CSS from a blog template, I’ve written the following.
This assumes that you know how to make a separate CSS work with your newly stripped .html file.
- In the tree, create a .html file and name it (hopefully under a CSS folder), ie., myCSSFile.html
- Get a template with internal CSS.
- Open it from within KompoZer.
- Click KaZcadeS on menu.
- Hit rule or in KopmpoZer just hit the painter’s palette.
- Hit “Create Style rule”.
- Select the “export stylesheet and switch to exported version”.
- Delete the internal CSS if it still shows on the left pane.
- “Save as” the adapted template to the appropriate folder.
- (You’re almost done.) At this point you’ve created an absolute local link. You need a relative link, thus open up KompoZer’s Source feature and edit the href to reflect this (on line 10-16 or so). ie., href=”file:///Users/MYUSER/Sites/public_html/myCSSFile.html” to something like “href=”../../public_html/myCSSFile.html”. (Hint: “../” is key; It’s working backwards. “../” dictates to look backwards relatively from where it started. The path stops once you hit the same level as the folder that contains the CSS file [named as a .html file, else KompoZer will not open it if you name it with a .css extension]).
Congratulate yourself and wipe the sweat off your brow; You’re done!
How to Test a new stylesheet in KompoZer
- Create a “Rule”, creates an “internal stylesheet”
- “@import” and input CSS url
- Select “Create Import-At-rule”
This is licensed under the Attribution-NonCommercial-ShareAlike 3.0 Unported Creative Commons License. All brands mentioned are properties of their respective owners. By reading this article, the reader forgoes any accountability of the writer. The reading of this article implies acceptance of the above stipulations. The author requires attribution –by full name and URL– and notification of republications.