# My CSS file won't show (even though everything says it should)

**URL:** <https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063>\
**Category:** Rails\
**Created:** [April 17, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063 "2008-04-17T15:37:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mister\_Blood\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Post date:** [April 17, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063/1 "2008-04-17T15:37:06Z")

</div>

i can’t get my app to use my css file (unless i remove the !DOCTYPE).  
in development mode with webrick i don’t have this problem, only here  
in production with mod\_rails:

\<VirtualHost \*:80\>  
ServerName [mysite.com](http://mysite.com)  
ServerAlias [www.mysite.com](http://www.mysite.com)  
DocumentRoot /services/httpd/mysite.com/public  
\<Directory “/services/httpd/mysite.com/public”\> # give apache access  
to the public/ folder…  
Options FollowSymLinks  
AllowOverride None  
Order allow,deny  
Allow from all  
  
RailsBaseURI /

i call my stylesheet like this:

\<%= stylesheet\_link\_tag ‘display’ %\>

which ends up looking like:

i can access [http://www.mysite.com/stylesheets/display.css](http://www.mysite.com/stylesheets/display.css) just fine.

i just don’t get it…

by removing from my header though, everything  
works, but i’m not removing my doctype…

thanks.

---

<div class="post-metadata">

**Author:** ![Mister\_Blood\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Post date:** [April 17, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063/2 "2008-04-17T18:53:16Z")

</div>

is it possible that HTML4 would not like the self-closed tag?  
try hard coding a

or using a more up to date doctype (e.g. XHTML 1 transitional) and see  
if that makes and difference

---

<div class="post-metadata">

**Author:** ![Mister\_Blood\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Post date:** [April 17, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063/3 "2008-04-17T18:57:23Z")

</div>

Try clearing your sessions and/or restarting your server. (Who  
knows.)

-Kyle

---

<div class="post-metadata">

**Author:** ![Mister\_Blood\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Post date:** [April 17, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063/4 "2008-04-17T22:14:30Z")

</div>

Hi, I would recommend checking your HTML against the following:

> **[Validation Results - W3C Markup Validator](https://validator.w3.org/check)**
>
> W3C's easy-to-use
> markup validation service, based on SGML and XML parsers.

Next, is there a particular reason why you’re not using XHTML?

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![Mister\_Blood\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@Mister\_Blood\_R](https://www.ruby-forum.com/u/Mister_Blood_R)\
**Post date:** [April 20, 2008, 10:39am UTC](https://www.ruby-forum.com/t/my-css-file-wont-show-even-though-everything-says-it-should/135063/5 "2008-04-20T10:39:48Z")

</div>

No, no reason, I just switched to XHTML now 🙂

Problem fixed though, turned out to be a lack of mod\_mime in Apache.

Thanks!
