CSS does not apply to PHP page

Here is part of my .php file:

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="IE=8" http-equiv="X-UA-Compatible"> <meta content="en-us" http-equiv="Content-Language"> <meta content="TEST" http-equiv="description"> <meta content="checkin, check-in, checkins, check-ins, checking-in, recommendations, popular, social, television, tv, show, shows, movie, movies, book, books, music, celebrity, game, games, video game, video games" http-equiv="keywords"> <title> Recommend Me: Find Me a Movie</title> <link href="/css/reset.css" media="screen,projection" type="text/css" rel="stylesheet"/> <link href="/css/home.css" media="screen,projection" type="text/css" rel="stylesheet"/> <link href="/css/dialog.css" media="screen,projection" type="text/css" rel="stylesheet"/> <link href="/css/modals.css" media="screen,projection" type="text/css" rel="stylesheet"/> <script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script> </head> <body> 

The file structure is here:

enter image description here

Why can't I get a page formatted as css? Removing these links to css didn't make any difference!

+4
source share
2 answers

Try removing the leading slash. A leading slash indicates that the path starts at the root of the website, which may not be the Source Files directory.

In other words, use css/reset.css instead of /css/reset.css .

+3
source

You forgot to close the <meta> tags (use <meta ... /> with a slash in front of > ). Thus, the browser can ignore anything after <meta content="IE=8" http-equiv="X-UA-Compatible"> , since it is not included in the <meta> .

However, since browsers can usually understand crappy HTML, this may not be the cause of your problem. Are you sure the CSS stylesheets are loaded from the correct URL? Check if http://yourdomain/css/reset.css . You can also just remove the main slash in the style sheets.

+1
source

Source: https://habr.com/ru/post/1340460/


All Articles