Currently, I have an asp.net page with the following code displayed below:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style>
body {
margin: 0px;
}
header,
footer {
background-color: black;
color: white;
padding: 20px;
text-align: center;
}
header {
position: fixed;
top: 0;
width: 100%;
}
header li {
display: inline-block;
border: 1px solid rgb(0, 153, 255);
background-color: dodgerblue;
}
header li:hover {
background-color: white;
}
header a {
text-decoration: none;
color: white;
padding: 15px;
}
header a:hover {
color: dodgerblue;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<header runat="server">
<h1>Welcome to SAIC</h1>
<asp:Menu ID="MainMenu" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Value="Home" NavigateUrl="~/Home.aspx"></asp:MenuItem>
<asp:MenuItem Value="Login" NavigateUrl="~/Login.aspx"></asp:MenuItem>
<asp:MenuItem Value="Add Products" NavigateUrl="~/Add Products.aspx"></asp:MenuItem>
<asp:MenuItem Value="View Product Details" NavigateUrl="~/View Product Details.aspx"></asp:MenuItem>
</Items>
</asp:Menu>
</header>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<footer>
<p>Copyrights @ 2016</p>
</footer>
</form>
</body>
</html>
The issue I am currently facing is that when applying padding to the anchor tag, only the padding-top
and padding-bottom
are being set. The left and right padding are not visible.
I attempted to set padding: 15px 15px 15px 15px;
, but unfortunately, this did not resolve the issue either.
Upon inspecting the generated source, I noticed that /* <![CDATA[ */
is automatically being generated. You can view the generated source here.