-1
<html>

<head>

<title> HELLO </title>

<link rel="stylesheet" type="text/css"  href="back.css"/>

</head>

<body>

<h1> WELCOME TO THE NEW WORLD </h1>

<p>  This is the world of Oppurtunities </p>

</body>

</html>

the css file is below.

body{
    background-color: darkslategrey;
    color: azure;
     }

h1{
    color: coral;
     }

piet.t
  • 11,718
  • 21
  • 43
  • 52
  • 1
    show us the files tree of the project also, please – Santi Mar 14 '19 at 14:29
  • 1
    Is back.css in the same folder as your html file? Also, remove the closing slash on your link element. – j08691 Mar 14 '19 at 14:35
  • I can't reproduce the problem. It works fine when I copy/paste your data. Probably you just have a typo in the URL. – Quentin Mar 14 '19 at 14:37
  • What do you mean this code, please write some about this code!. – Md. Abu Sayed Mar 14 '19 at 14:37
  • Do you get any errors in your browser console? Also when you say "does not work" do you refer to the stylesheet not loading or the style not being applied correctly? – Mathyn Mar 14 '19 at 14:40

2 Answers2

0

You question is pretty vague but your path to the CSS is probably off.

Without more info on your dev environment this is my best suggestion.

Change your CSS link to...

<link rel="stylesheet" type="text/css" href="../back.css"/> Notice the ./back.css

This may not be the correct path to the file but your issue lies in your relative path. It all depends on your file structure.

Basic Examples

<link rel="stylesheet" type="text/css" href="/back.css"/>

<link rel="stylesheet" type="text/css" href="../back.css"/>

<link rel="stylesheet" type="text/css" href="/someFolder/back.css"/>

RiddleMeThis
  • 1,345
  • 4
  • 16
  • 29
  • 2
    `./back.css` and `back.css` resolve to exactly the same URL. This cannot make any difference. – Quentin Mar 14 '19 at 14:36
0

Perhaps putting the css file into a folder might work out.

<link rel="stylesheet" type="text/css"  href="styles/back.css"/>

That usually does the trick, let us know ;)!

A Hus
  • 26
  • 2