简体   繁体   English

Html and Css that I created outside ASP.NET doesn't fit when I add it in ASP.NET CORE Razor

[英]Html and Css that I created outside ASP.NET doesn't fit when I add it in ASP.NET CORE Razor

I created the html and css for My Profile page and when I added that html and css in ASP.NET CORE it looks different. I created the html and css for My Profile page and when I added that html and css in ASP.NET CORE it looks different.

This is how it looks when I open it from index.html这是我从 index.html 打开它时的样子

在此处输入图像描述

And when I added it in ASP cshtml along with styles.css当我将它与 styles.css 一起添加到 ASP cshtml 中时

在此处输入图像描述

Some differences in cshtml: cshtml的一些区别:

  1. Save Changes button is not exactly where it should be “保存更改”按钮不完全是它应该在的位置
  2. The Dashboard header is center aligned仪表板 header 居中对齐
  3. Dashboard boxes are in different places and different widths(I used bootstrap row and columns to fit them)仪表板框位于不同的位置和不同的宽度(我使用引导行和列来适应它们)
  4. There is no space between Login Details,Dashboard and Reservations登录详细信息、仪表板和预订之间没有空格

What can be the reason for this?这可能是什么原因?

The problem is that I had an reference to an different bootstrap version library in the layout file.问题是我在布局文件中引用了不同的引导版本库。

This one: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous" />这个: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous" />

and the version of bootstrap I used for my html was 5.0.0, so I just removed the reference to bootstrap in layout and I added the new one: <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">我用于 html 的引导程序版本是 5.0.0,所以我只是删除了布局中对引导程序的引用并添加了新的: <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">

It's working now.它现在正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法在 ASP.NET Core MVC 中添加视图 - I can't add view in ASP.NET Core MVC 在 ASP.NET Core 中创建新线程时如何添加回调? - How can I add a callback when a new thread is being created in ASP.NET Core? 如何加载网站,然后在 Asp.Net Core (C#) Razor Pages 中添加数据 - How can I load the website and then later add data to it in Asp.Net Core (C#) Razor Pages 我可以从ASP.NET应用程序外的ASP.NET页面对象中呈现html吗? - Can I render html from ASP.NET Page objects outside ASP.NET applications? 如何将用户添加到 razor 页面 asp.net 核心中创建的角色 - How to add users to created roles in razor pages asp.net core 如何在asp.net核心剃须刀页面中重用HTML代码段? - How to reuse HTML snippets in asp.net core razor page? 当我将电子邮件代码上传到主机(godaddy-windows 主机)(Asp.net core (.net 5.0))时,我的电子邮件代码不起作用 - My email code doesn't work when I upload it to the host (godaddy- windows host) (Asp.net core (.net 5.0)) 在ASP.NET MVC中使用Razor时如何将类添加到单选按钮 - How do I add a class to a radio button when using Razor in ASP.NET MVC ASP.NET Core 2.0-Razor-授权 - ASP.NET Core 2.0 - Razor - Authorize 我可以将 ASP.NET Core MVC 添加到现有的 ASP.NET Web Z645024253191A381C36Z83CAE8 - Can I add ASP.NET Core MVC to existing ASP.NET Web Forms Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM