My CSS won't work


I am trying co get my CSS to work on my site, and it isn’t working. Just to give you an idea of what is happening, here is the coding:

<!DOCTYPE html>
    <title>Hawkblade's Themes</title>
    <link rel="stylesheet" type="text/css" href="/">
  <h1>Welcome to HawkBlade's themes!</h1>
font-family: arial;
font-size: 12px;    

h1 {
font-family:Times New Roman;

Is there anything wrong?


Can you link to the page? It may be how you’re calling the file :slight_smile:


Yes I can link to the page, but when i link to the page, I get the “Index of /” is there any way to get rid of that?


The path to your CSS file looks… odd. It needs to be relative to your site root, not to your FTP account — unless there is a folder called “” inside your web directory (which there doesn’t appear to be), you should just be linking to it as “/style.css”.

Also, you cannot (and do not need to) style the “html” element in CSS, as it is never rendered on screen. The highest-level element “visible” to CSS is the “body” element. Additionally, if you are going to change the background color, you should probably also set the foreground color (using the “color” attribute), as the user’s default colors may clash with the background you set.


Ah, okay. So all I have to do is just place a forward slash behind my css file? That seems to be easy enough.


If it’s in the same folder, you can do “style.css” on it’s own. The leading / says ‘In my main folder…’

Also the reason you get ‘index of…’ is because you don’t have an index file :slight_smile: Make one named index.html or index.php to fix that :slight_smile:


Thank you again, I love the support that you guys give, you rock!