Results 1 to 7 of 7

Thread: [RESOLVED] v Studio 2019 CSS

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Texas
    Posts
    246

    Resolved [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?

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,612

    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



  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Texas
    Posts
    246

    Re: v Studio 2019 CSS

    Quote Originally Posted by NeedSomeAnswers View Post
    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>

  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,612

    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



  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Texas
    Posts
    246

    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

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Texas
    Posts
    246

    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.

  7. #7
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,612

    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
  •  



Click Here to Expand Forum to Full Width