James Dorfman
James Dorfman

Reputation: 1818

CSS stylesheet not linking to my html page

I have a problem where my css does not affect my html. I made a fiddle here It worked when I wasn't trying to connect an external stylesheet and used style tags, Thanks in advance to anyone who can help.

btw i tried

<link rel="stylesheet" type="text/css" href="index.css">

and it did not work.

Upvotes: 0

Views: 30529

Answers (4)

James Dorfman
James Dorfman

Reputation: 1818

You put #button instead of input, #button in the css.

Upvotes: 0

iamspialeo
iamspialeo

Reputation: 11

As stated also by BuddhistBeast, check to make sure it's in between the head tags:

<head>
<link href="index.css" type="text/css" rel="stylesheet" /> 
</head>

Also check that you are referencing it correctly. If it is all in one folder, then

<link href="index.css" type="text/css" rel="stylesheet" /> 

is correct.

If it's in its own folder, named "css" for example, it should be written as:

<link href="css/index.css" type="text/css" rel="stylesheet" />

Upvotes: 1

David Sawyer
David Sawyer

Reputation: 557

The fact that you are linking to simply index.css worries me. Is index.css in your site root? If so, specify that:

<link rel="stylesheet" type="text/css" href="/index.css">

Upvotes: 1

BuddhistBeast
BuddhistBeast

Reputation: 2670

Make sure you are linking it in your 'head' section of the HTML such as this:

<head>
    <link href="index.css" type="text/css" rel="stylesheet" /> 
</head>

Also be sure to close the tag and that the style sheet you are linking is named 'index.css'

Edit:

HTML is split up into two main section tags: body and head. In a normal HTML page, the structure is like so:

<html>
    <head>
    </head>
    <body>
    </body>
</html>

The code I referenced at the beginning of this answer should be placed into the head section of the HTML page.

Upvotes: 3

Related Questions