MyBB Community Forums
Adding a stylesheet - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: Adding a stylesheet (/thread-44917.html)



Adding a stylesheet - Ferron - 2009-02-08

I want to add a stylesheet using conditional comments because my theme is messed up in IE. I added ie.css in the Stylesheets group to act as the IE stylesheet. How would I enter it in HTML using conditional comments? Or would I have to manually insert a stylesheet by FTP and link to that?


RE: Adding a stylesheet - x_Stricken_x - 2009-02-08

<[if ie]>
... Include your CSS stylesheet here...
<[/if]>
Should work.


RE: Adding a stylesheet - Ferron - 2009-02-08

(2009-02-08, 10:48 PM)TomL Wrote:
<[if ie]>
... Include your CSS stylesheet here...
<[/if]>
Should work.
I know how to use conditional comments but I want to know how to get the link to the stylesheet. Because it's entered in dynamically, I don't know how to do that without editing global.php.


RE: Adding a stylesheet - jlong1 - 2009-02-11

(2009-02-08, 10:57 PM)computergeek67 Wrote:
(2009-02-08, 10:48 PM)TomL Wrote:
<[if ie]>
... Include your CSS stylesheet here...
<[/if]>
Should work.
I know how to use conditional comments but I want to know how to get the link to the stylesheet. Because it's entered in dynamically, I don't know how to do that without editing global.php.

Try this:

Go to: 'Admin CP-> Templates & Style-> Theme-> (Your theme) -> global.css'.

Add an enter at the beginning of line 1 so that you get another line above it and note the theme number in the URL at the top of the browser.

Example:
http://forum.kronosandoranos.co.cc/admin/index.php?module=style/themes&action=edit_stylesheet&file=global.css&tid=[b]2[/b]

The part in bold is your theme number.

Then, put in the conditional comments before anything else:

[code]
<[if ie]>
@import "./cache/themes/theme*/ie.css";
<[/if]>

Replace the '*' with your theme number.

Click Save and it should work.

Jlong1


RE: Adding a stylesheet - Ferron - 2009-02-12

Thank you, jlong1! It works.


RE: Adding a stylesheet - jlong1 - 2009-02-12

(2009-02-12, 01:27 AM)computergeek67 Wrote: Thank you, jlong1! It works.

No problem.