gpt4 book ai didi

css - header ASP.NET Core MVC 中的站点 Logo

转载 作者:太空宇宙 更新时间:2023-11-04 09:17:12 25 4
gpt4 key购买 nike

我有以下图片标签,我正试图将其添加到我的网站。

<a href="@Url.Action("Index", "core")" class="navbar-brand">
<img src="~/images/core.png" title="core" alt="additional title" />
</a>

我已经尝试在我的 _Layout.cshtml 页面的头部和正文标签中添加此标签,但它刚好在标题下方。我应该在哪里添加标签,以便它出现在左上角网站?

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>@ViewData["Title"] - core</title>

<environment names="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
@Html.ApplicationInsightsJavaScript(TelemetryConfiguration)
</head>
<body>

<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-area="" asp-controller="core" asp-action="Index" class="navbar-brand">core</a>
</div>
<div class="navbar-collapse collapse">

</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; 2017 - core Inc. - core</p>
</footer>
</div>

<environment names="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>

@RenderSection("scripts", required: false)
</body>
</html>

在正文中,但这会将 Logo 放在头部下方。

<body>
<a href="@Url.Action("Index", "core")" class="navbar-brand">
<img src="~/images/core.png" title="core" alt="additional title" />
</a>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
.
.
.

enter image description here

最佳答案

我自己弄明白了。它需要进入 <div class="navbar navbar-inverse navbar-fixed-top">

<div class="navbar navbar-inverse navbar-fixed-top">
<a href="@Url.Action("Index", "core")" class="navbar-brand">
<img src="~/images/core.png" title="core" alt="" />
</a>
<div class="container">
<div class="navbar-header">

enter image description here

关于css - header ASP.NET Core MVC 中的站点 Logo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41684164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com