Currently, I am developing an asp.net website using webforms in Visual Studio 2017 version 15.2 (26430.16) and Microsoft .NET Framework version 4.7.03056 (targetFramework .NET = 4.5.2).
After creating the solution, a bootstrap.css file along with Site.master is generated.
While modifying the bootstrap.css file, I noticed that the changes reflect on the localhost but not on the live website after publishing.
An excerpt from my 'Site.master' page:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<title>CompanyX | <%: Page.Title %></title>
...
</head>
<body>
...
<form runat="server">
<asp:ScriptManager runat="server">
...
</asp:ScriptManager>
<div class="navbar navbar-inverse navbar-fixed-top">
...
</div>
<div class="container body-content">
...
</div>
</form>
</body>
I made modifications to the 'bootstrap.css' file:
.navbar-nav > li > a {
margin-top: 10px;
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
font-size: medium;
}
The addition of margin-top: 10px;
aligned elements within navbar-collapse collapse
horizontally with those in navbar-brand
.
These changes were expected to be reflected on both localhost and the published website.
I attempted adding the following code to
asp:ContentPlaceHolder ID="Stylesheets"
for extra reference to 'bootstrap.css', unfortunately with no success:
<link rel="stylesheet" runat="server" href="/Content/bootstrap.css" type="text/css" />
Your insights are highly valued.
Visual representation of the outcome can be viewed below: https://i.sstatic.net/vmcCT.png
...Update:
Upon examining the source code, it seems there's some anomaly present.
CSS rendering code in my Site.master: https://i.sstatic.net/DDk3x.png
Source code on localhost: https://i.sstatic.net/13EK9.png
Source code on the published website: https://i.sstatic.net/4BayH.png
Furthermore, upon realizing the redundancy of
ContentPlaceHolder ID="Stylesheets"
, I have removed it from my code, though the issue persists. Any thoughts on this inconsistency?