有人可以向我解释如何在 a 的底部移动 a !我不敢相信我正在为一些我认为很简单的事情而苦苦挣扎。
我正在使用 .net 中提供的 mvc 模板(html5),代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left" style="border: 2px solid red">
<p class="site-title">
@Html.ActionLink("My website", "Index", "Home")
</p>
</div>
<div class="float-right" style="border: 2px solid red;">
<section id="login">
@Html.Partial("_LoginPartial")
</section>
<nav>
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
</nav>
</div>
</div>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>
© @DateTime.Now.Year - MyWebsite.com</p>
</div>
</div>
</footer>
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
虽然没有在上面的代码中显示,但我的 div 的高度将为 101px,我希望导航菜单显示在 div 内的右下方,但我尝试在 site.css 中使用各种设置并使用内联样式,正如我所说,我无法让它显示在我想要的位置!我仍在谷歌搜索,但希望有人能为我提供解决方案。我在这上面花了太多时间!
谢谢。