ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Trouble with CSS in Template

October 27, 2013 11:05pm

Subscribe [2]
  • #1 / Oct 27, 2013 11:05pm

    mpar612

    19 posts

    Hi Everyone,

    I’m new to EE and could use a hand.  My client has a fresh install of ExpressionEngine and CartThrob.  The site is being hosted on GoDaddy.

    I have created templates and referenced some CSS using:

    <link href="{stylesheet='shop/styles.css'}" rel="stylesheet" type="text/css" />

    The CSS does not appear to be working.  I appears in the view source as

    <link href="http://lavivahomedesign.com/index.php?css=includes/css/styles.css" rel="stylesheet" type="text/css" />

    Also, I have scoured the root directory and I cannot find any .htaccess files.

    Any thoughts?

    Thanks in advance!

  • #2 / Oct 28, 2013 5:29am

    Ralph

    78 posts

    Try removing the .css so it reads

    <link href="{stylesheet='shop/styles'}" rel="stylesheet" type="text/css" />
  • #3 / Oct 29, 2013 10:22pm

    mpar612

    19 posts

    Thanks for the idea!  I gave it a try and that didn’t work.

    I made a mistake in my post.

    Just to clarify, I have this in my template:

    <link href="{stylesheet='shop/styles.css'}" rel="stylesheet" type="text/css" />

    I viewed the source on the front-end and it shows as this:

    <link href="http://lavivahomedesign.com/index.php?css=shop/styles.css.v.1382924054" rel="stylesheet" type="text/css" />

    Any other thoughts?

    Thanks!

  • #4 / Oct 30, 2013 5:11am

    Ralph

    78 posts

    It looks like the {stylesheet} tag is working fine but it’s not returning anything. Try enabling PHP errors for everyone, clearing your cache and synchronising templates (if you’re saving templates as files). I usually put my CSS outside of EE so if all else fails you could do that.

  • #5 / Oct 30, 2013 5:15am

    Ralph

    78 posts

  • #6 / Oct 31, 2013 10:14pm

    mpar612

    19 posts

    Thanks for the reply!

    I performed the steps you suggested and I still can’t seem to get CSS to work.

    By saying that you put your CSS outside of EE, are you saying you simply reference CSS the standard HTML way with a path to the proper CSS file and putting the CSS files in the root diretory?

    I’m going to give that a try.

    Thanks!

  • #7 / Nov 01, 2013 12:07pm

    Ralph

    78 posts

    Yup, you can just put the css in a /css folder and reference it directly.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases