Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

how can I configure my auto synk browser link with google chrome?

my site.css file is not being aplied, but my bootstrap file does, is my first time using .Net Core version 4.6.1 and my first time using visual studio actually, so I don't know much about configuration stuff.

Fredrik Rönnehag
Fredrik Rönnehag
2,342 Points

If you check the _layout.cshtml it contains the base layout for all your pages. You need to link the site.css to your _layout, if you want it for all your pages.

<environment include="Development">
    <link rel="stylesheet" href="~/css/site.css" />
</environment>

Make sure your site.css is inside a folder named css. To add a folder right click solution name -> Add -> New Folder -> Name it css. Put site.css inside that folder.

this is what I have in my head of _layout.cshtml and my site.css is in the content folder, I also tried putting bootstrap first and then my site.css but nothing changed.

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - Comic Book Gallery</title>
    <link href="~/Content/site.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/bootstrap.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/modernizr-2.6.2.js"></script>
</head>

also when I inspect the page in chrome browser it doesn't load the new content I write in site.css file, thank you for your answer.

https://drive.google.com/file/d/0B_aiBEu6MvWibEp2MkxZYjFoX2ZBVERBV0hWUmhNRWhHT0Ew/view?usp=sharing
when I write in my site.css from the inspector is all working good but if I do it from visual studio nothing happens so that's why I think is a problem of configuration of the auto sync browser link feature.

Fredrik Rönnehag
Fredrik Rönnehag
2,342 Points

Im not quite sure I understand what you mean. But if I get you right you want to make changes in the css while the page is running? Just press ctrl shift B to build the solution and hit refresh on the website.

no, I just want to refresh the page and see the changes, but when I save my changes and run the page nothing change, for example if I change the color of an <a> element in visual studio nothing happens but if I write the exact same css code from the inspector in my site.css file it does work, sorry if I'm not making myself clear.

1 Answer

Hey! now I installed the browser sync feature and started a new proyect and now works perfectly, thanks guys, this case is a closed issue :) and also I want to say that Treehouse community is awsome in other sites like Udemy I remember I used to wait days for the moderator to answer but here people do it in a blink!! thanks ;)