-
Apr 14th, 2020, 04:08 PM
#1
Thread Starter
Addicted Member
[RESOLVED] v Studio 2019 CSS
I’m using Visual Studio 2019 community edition. When I create an html page in designer it shows as expected but when I open the page from visual studio it’s opened using local host and none of the css formatting is used. If I open the page from the file manager using Edge, Firefox, or Chrome the page opens just fine. Why is this happening and how can I fix it?
-
Apr 16th, 2020, 04:28 AM
#2
Re: v Studio 2019 CSS
Well how are you including the stylesheet css file in your webpage? can you post your html code so we can see ?
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Apr 16th, 2020, 07:52 PM
#3
Thread Starter
Addicted Member
Re: v Studio 2019 CSS
Originally Posted by NeedSomeAnswers
Well how are you including the stylesheet css file in your webpage? can you post your html code so we can see ?
Here is the beginning of my html code thru the top menu. It shows fine when I open from file system, but when I open with visual studio it uses local host and no css is used.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Working Dogs</title>
<link rel="stylesheet" type="text/css" href="../../styles/BossStyle.css"/>
<link rel="stylesheet" type="text/css" href="../../styles/MenuStyle.css"/>
</head>
<body>
<ul id="menu-bar">
<li class="active"><a href="fav01.htm">Home</a></li>
<li><a href="#">BJ</a>
<ul>
<li><a href="Boxer.HTM"></a></li>
<li><a href="#">Products Sub Menu 2</a></li>
<li><a href="#">Products Sub Menu 3</a></li>
<li><a href="#">Products Sub Menu 4</a></li>
</li>
<li><a href="#">Test</a>
<ul>
<li><a href="Dog01.htm">Basic Breeds</a></li>
<li><a href="#">Services Sub Menu 2</a></li>
<li><a href="#">Services Sub Menu 3</a></li>
<li><a href="#">Services Sub Menu 4</a></li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
-
Apr 17th, 2020, 04:56 AM
#4
Re: v Studio 2019 CSS
it probably doesn't like your relative path
Whats your folder structure like? do you have your style-sheet 1 or 2 levels down from your web pages?
in most apps you will have your pages on one level and then you might have your style-sheet in a sub folder called styles or something and in that case you would just need ../ once.
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Apr 20th, 2020, 07:09 PM
#5
Thread Starter
Addicted Member
Re: v Studio 2019 CSS
Thanks NeedSomeAnswers
You were right. when I changed my folder structure as you suggested - it works. I still don't understand why there was a problem using local host to view the file but when I opened the same file from file explorer using firefox or another browser it rendered just fine.
Thanks for you help
-
Apr 20th, 2020, 07:10 PM
#6
Thread Starter
Addicted Member
Re: v Studio 2019 CSS
Thanks NeedSomeAnswers
You were right. when I changed my folder structure as you suggested - it works. I still don't understand why there was a problem using local host to view the file but when I opened the same file from file explorer using firefox or another browser it rendered just fine.
Thanks for you help
Sorry for the duplicate post. If I could figure out how to mark this as resolved I would have
Last edited by gem1204; Apr 20th, 2020 at 07:17 PM.
-
Apr 22nd, 2020, 03:57 AM
#7
Re: [RESOLVED] v Studio 2019 CSS
No problem,
relative paths work a little differently in the web than in a file system.
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|