0

I have created an intranet website(i am new to website creation) and the HTML view was perfect without any errors in all browsers. i have made it has local host with IIS on the same system i am working with. But when i tried to load it on any browser it loaded the page with just the content on it without any style that i made in the css definition it shows an error "MainMenu.css 404 (Object Not Found)"

Q1. Should i also define my css location in the IIS.

Q2. should i have to declare any line on the html

below is my code:

<!doctype html>
<html>
<head>
<link href="../css/MainMenu.css" rel="stylesheet" type="text/css">
<meta charset="ISO-8859-1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-Type" content="text/html, charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DOCUMENTATION</title>
</head>
<body>...</body></html>
insomniac
  • 11,146
  • 6
  • 44
  • 55

1 Answers1

1

Your call to the CSS:

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

Is saying look in the directory above this one, look for a directory called 'css' and find 'MainMenu.css'.

This infers a directory structure like this:

/top/
   /wwwroot/
      ... index.html etc ...
   /css/
      MainMenu.css

It's more likely that the directory structure looks like this:

  /wwwroot/
      index.html etc.
      /css/
          MainMenu.css

With the css directory within the site root (wwwroot in my example).

Therefore, your link should look like this:

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

For a relative path, or this:

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

For an absolute path (better)

Hope this helps ?

Pat Dobson
  • 3,249
  • 2
  • 19
  • 32