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

**URL:** <https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912>\
**Category:** General\
**Created:** [January 16, 2021, 7:18am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912 "2021-01-16T07:18:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![neongum17](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/neongum17/32/185486_2.png) [@neongum17](https://forum.freecodecamp.org/u/neongum17)\
**Post date:** [January 16, 2021, 7:18am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/1 "2021-01-16T07:18:56Z")

</div>

![SharedScreenshot](https://global.discourse-cdn.com/freecodecamp/original/3X/e/7/e7c07afea10b9c8ba27625a7338ab359c5c5d7be.jpeg)

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

---

<div class="post-metadata">

**Author:** ![miku86](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/miku86/32/95580_2.png) [@miku86](https://forum.freecodecamp.org/u/miku86)\
**Post date:** [January 16, 2021, 7:46am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/2 "2021-01-16T07:46:32Z")

</div>

Hey there,

nice to meet you! 👋

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?

---

<div class="post-metadata">

**Author:** ![krishnasai3cks](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/krishnasai3cks/32/170120_2.png) [@krishnasai3cks](https://forum.freecodecamp.org/u/krishnasai3cks)\
**Post date:** [January 16, 2021, 7:49am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/3 "2021-01-16T07:49:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![neongum17](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/neongum17/32/185486_2.png) [@neongum17](https://forum.freecodecamp.org/u/neongum17)\
**Post date:** [January 16, 2021, 7:51am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/4 "2021-01-16T07:51:00Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![krishnasai3cks](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/krishnasai3cks/32/170120_2.png) [@krishnasai3cks](https://forum.freecodecamp.org/u/krishnasai3cks)\
**Post date:** [January 16, 2021, 7:52am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/5 "2021-01-16T07:52:35Z")

</div>

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

```auto
body{
 background-color:blue;
}

```

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

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 7:53am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/6 "2021-01-16T07:53:49Z")

</div>

how have you linked the css to the html?

---

<div class="post-metadata">

**Author:** ![neongum17](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/neongum17/32/185486_2.png) [@neongum17](https://forum.freecodecamp.org/u/neongum17)\
**Post date:** [January 16, 2021, 7:55am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/7 "2021-01-16T07:55:28Z")

</div>

i linked it externally  
adding tag in html itself

---

<div class="post-metadata">

**Author:** ![neongum17](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/neongum17/32/185486_2.png) [@neongum17](https://forum.freecodecamp.org/u/neongum17)\
**Post date:** [January 16, 2021, 7:57am UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/8 "2021-01-16T07:57:12Z")

</div>

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  
}

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [July 17, 2021, 7:57pm UTC](https://forum.freecodecamp.org/t/html-are-only-seen-on-live-server-but-not-css-in-vs-code/440912/9 "2021-07-17T19:57:16Z")

</div>

Closed on July 17, 2021, 7:57pm UTC

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