1

This is what i get when i view the page source and CSS file is also correctly linked and it opens stylesheet when clicked on the link, yet CSS is not being rendered on page. any help would be appreciated.

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>React App</title>
    <link rel="stylesheet" src="main.css" />
  </head>
  <body>
    <script src="./src/index.js"></script>
    <div id="root"></div>
  <script src="/static/js/bundle.js"></script><script src="/static/js/vendors~main.chunk.js"></script><script src="/static/js/main.chunk.js"></script></body>
</html>
0

2 Answers 2

2

This is a basic issue change src to href it'll work. if you have a minute just glance @ Mozilla External Resource Link element https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link

 <link rel="stylesheet" href="main.css" />
Sign up to request clarification or add additional context in comments.

Comments

0

You are not embedding the source here. When you need to specify the source use => href

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>React App</title>
    **<link rel="stylesheet" href="main.css" />**
  </head>
  <body>
    <script src="./src/index.js"></script>
    <div id="root"></div>
  <script src="/static/js/bundle.js"></script><script src="/static/js/vendors~main.chunk.js"></script><script src="/static/js/main.chunk.js"></script></body>
</html>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.