Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My CSS won't link to my HTML file

I am trying to build a simple website in Sublime Text Editor 2, however, my CSS file won't link to my HTML file and therefore printing plain text. My HTML code is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/       xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Christopher Olson</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,600,700" rel="stylesheet" />

<link rel="stylesheet" href="css/style.css" />

As far as I know, the last line is supposed to link the CSS file.

This is part of the CSS that I have:

body, input, textarea
{
    font-family: 'Open Sans', sans-serif;
    line-height: 1.85em;
    color: #888;
    font-weight: 300;
}

Any ideas to fix? Please help

EDIT: I have the tags, I just ran out of room to post it

like image 850
ChriskOlson Avatar asked Nov 20 '25 16:11

ChriskOlson


2 Answers

Your path your CSS file is probably wrong. If you're sane your CSS directory is in the webroot so your <link> should probably look like this:

<link rel="stylesheet" href="/css/style.css" />
like image 93
John Conde Avatar answered Nov 23 '25 11:11

John Conde


Definitely is your link's href incorrect.

like image 42
MarkMoore Avatar answered Nov 23 '25 09:11

MarkMoore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!