아래와 같이 코드가있는 asp.net 페이지가 있습니다.앵커 태그 용 패딩
<%@ 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>
나는 앵커 태그에 패딩을 적용했습니다. 단 padding-top
과 padding-bottom
만 설정됩니다. 왼쪽과 오른쪽의 패딩이 나타나지 않습니다.
padding: 15px 15px 15px 15px;
을 설정하려고 시도했지만 작동하지 않습니다.
생성 된 소스입니다. /* <![CDATA[ */
이 자동으로 생성됩니다. https://jsfiddle.net/q2Lcrgux/
난 당신의 코드에서 앵커 태그를 볼 수 없습니다! 당신은 바이올린을 게시 할 수 있습니까? –
Asp.net이 마스터 페이지를 처리하고 메뉴 항목이 앵커 태그로 변환됩니다. 다음은 생성 된 소스 https://jsfiddle.net/q2Lcrgux/ –
ok입니다. –