Html are only seen on live server but not css in VS code

    • Is this a problem over there?
      are my HTML and CSS files linked before opening in the server?
      please help me out

Hey there,

nice to meet you! :wave:

I’m having a hard time to understand your issue.

Please give us more information.
What do you expect to see?
What does actually happen?
What have you tried so far?

Hello, the first problem I want you to solve is to remove empty rule sets. ( It doesn’t affect anything).
And also the complete code(if you can) or atleast some additional information about the problem can also help.

I see an underline in line 3 of your css file. I guess you may have made a syntax error in the first line of your css file. Maybe that is why css is not being rendered.

1 Like

i tried building a webpage using html and css on vs code but only the html code shows upon the live server and no styling takes place .

If you have correctly linked the css stylesheet inside your index.html file. Then the problem is that your css file is not being compiled correctly. Once check for any potential mistakes in the first line of your code.

Or you can also debug using

body{
 background-color:blue;
}

at the first line of your css file to ensure that css file is loaded properly

how have you linked the css to the html?

i linked it externally
adding tag in html itself

asterisk seems to be problem in my code so I get an error like this:
{
“resource”: “/f:/C/travel/style.css”,
“owner”: “generated_diagnostic_collection_name#0”,
“code”: “css-mediaqueryexpected”,
“severity”: 8,
“message”: “media query expected”,
“source”: “css”,
“startLineNumber”: 3,
“startColumn”: 1,
“endLineNumber”: 3,
“endColumn”: 2
}

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.