我的目标是显示页眉和页脚内联表样式,您将在我的menu.css中看到,当此页面运行时,页眉和页脚根本没有出现,但在VS的设计视图中,它们看似正常,但不是内联的。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Home Page</title>
<link type="text/css" href="menu.css" rel="stylesheet" />
</head>
<body style="background: black; text-align: center">
<header class="menu">
<ul>
<li><a href="HomePage.aspx">Home</a></li>
<li><a href="Registration.aspx">Become a Member</a></li>
<li><a>User Information</a>
<ul class="subMenu">
<li><a href="BasicInformation.aspx">Basic Information</a </li>
<li><a href="DeliveryInformation.aspx">Delivery Infomation</a></li>
</ul></li>
<li><a href="Order.aspx">Make Order</a></li>
</ul>
</header>
<form id="form1" runat="server">
<div>
<p style="background-color: #000000">
<asp:Image ID="bsuImage0" runat="server" Height="200px" ImageUrl="~/Logo/BallStateCardinals02.jpg" class="pic" />
<asp:Label ID="messageLabel" runat="server" Text="Welcome to Ball State Pizza" Font-Bold="True" Font-Italic="True" Font-Names="Simplified Arabic" Font-Size="50pt" ForeColor="Red"></asp:Label>
<asp:Image ID="bsuImage" runat="server" Height="200px" ImageUrl="~/Logo/BallStateCardinals02.jpg" class="pic" />
</p>
</div>
</form>
<footer class="menu">
<ul>
<li><a href="Contact.aspx">Contact Us</a></li>
<li><a href="#top">Back to Top</a></li>
</ul>
</footer>
</body>
</html>
这是我的menu.css,它在页眉和页脚中为菜单类设置样式。
body {}
.menu ul li {display: inline-table; margin-left: 100px;}
.menu ul{padding:0; text-align: center;}
.menu ul li .subMenu{display:none; width:150px;}
.menu ul li:hover > .subMenu {display: block;}
.menu ul li .subMenu li {margin:0; padding-top:5px;}
.menu ul li a{font-size:15px; text-decoration:wavy; color:white;}
.menu {font-size:15px; text-decoration:wavy; color:blue; background-color: red;}
.menu ul li {text-align: center}