简体   繁体   中英

css doesn't apply at all

Its very strange, when I run my page css style doesn't apply to the elements. Ex. top_login. When I try to debug in firebug it doesn't show that any css style was applied. Here is fiddle feed http://jsfiddle.net/rPyn8/7/ . It works and all styles are applied there. But if try to link css file it doesn't work. To replicate this issue need create local files and open it in browser

Your path is incorrect.If stylesheet is in "css" folder in your main directory then change :

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

TO

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

Your css has some error. for example cursor:hand is not css property and form is tag so dont you tag name as a class name

check here you css working fine

Here its working when I tried to include your css in the head part like this

<head>
 <style>
put your css here
 </style>
 </head>

You just check your css path.I think there is something wrong.Make your css link like this

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

Try to validate your html codes.

If it doesn't work on your local machine (from the file system folder, not a web server) is because of absolute path in your tag.

Your file structure should be:

MyTestFolder
  |-- css
  |   |-- admin.css
  |-- test.html

You <link> tag in the html page should be:

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

Also in your admin.css you are using rooted paths to resources /images/admin/center_form.gif etc. you should make them relative paths (from the location of the CSS file by default): images/admin/center_form.gif . Change all of them

So expanding your directory structure, it should look similar to:

MyTestFolder
  |-- css
      |-- images
          |-- admin
              |--center_form.gif
  |   |-- admin.css
  |-- test.html

the problem is in .htaccess. The path is correct but there is some rules need to change

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM