The external CSS file is not connected, but if you add the same styles from the CSS file to the html, everything works, the file path was checked several times, everything is correct. Why styles may not work?

<link href="/resources/style.css" rel="stylesheet"> 
 /* Eric Meyer's CSS Reset */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { line-height: 1; background-image:resursi/background.jpg; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; } /* End of Eric Meyer's CSS Reset */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } body { font: 12px/18px Arial, sans-serif; width: 100%; } .wrapper { width: 1000px; margin: 0 auto; } /* Header -----------------------------------------------------------------------------*/ .header { height: 150px; background: #00FFFF; } /* Middle -----------------------------------------------------------------------------*/ .content { background-color:#FFFFFF; } /* Footer -----------------------------------------------------------------------------*/ .footer { height: 100px; background: #BFF08E; } 

Or is something wrong with the operator? where am I wrong?

http://imgur.com/bgc1Gkr now this error pops up

  • /resources/style.css remove the fraction at the end, the first fraction is the root of the site, do you have site.ru/resources/style.css? - Jean-Claude
  • the file is /public_html/resources/style.css - Fortegon
  • public_html is a folder within the domain or just on the hosting you see? - Jean-Claude
  • In chrome or fireball in the developer’s tools (press F12) on the tabs, the console and the network have any curses / errors? - Webaib
  • There are no errors, but I noticed that in the Elements laying in Styles there is no thing that I wrote at all - Fortegon

2 answers 2

Firstly, why is there a slash at the end?
It should be:

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

Next, we check if the path is correctly specified, at the beginning is a slash, then the path will be from the root of the site, for example:

 ya.ru/resources/style.css 

And if you go this way in the browser you have to get this file, is this what happens?

And how is it that <link> you have with CSS, it should be in the HTML document, and if it is, then the rest of the CSS should be enclosed in the <style>

It is also worth making sure that the file is really uploaded to the server successfully.

Next, pay attention to the htaccess file, maybe something is not configured in it.

  • <link> is not in the same file with the styles, just asked to show the styles file if you go to the url of the css file there is empty, but I checked the path several times already ..... can this be something else? - Fortegon
  • если зайти по url css файла там пусто - it shouldn’t be that way, it means the server doesn’t correctly give the file, where is all this on your hosting? - Mr_Epic
  • yes on hosting (Hostinger) - Fortegon
  • Can you provide a link and I will look, what's wrong? - Mr_Epic
  • to your website ?? (if so then poligonfotester.xyz/) (there is really nothing there) - Fortegon

<style>@import "resources/style.css"</style> MB TAK

  • Sorry, can be a little more detail? Or are these just your assumptions? - 0xdb 5:02 pm