博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转]Build beautiful, responsive sites with Bootstrap and ASP.NET Core
阅读量:4944 次
发布时间:2019-06-11

本文共 2361 字,大约阅读时间需要 7 分钟。

本文转自:

Bootstrap is currently the most popular web framework for developing responsive web applications. It offers a number of features and benefits that can improve your users' experience with your web site, whether you're a novice at front-end design and development or an expert. Bootstrap is deployed as a set of CSS and JavaScript files, and is designed to help your website or application scale efficiently from phones to tablets to desktops.

Get started

There are several ways to get started with Bootstrap. If you're starting a new web application in Visual Studio, you can choose the default starter template for ASP.NET Core, in which case Bootstrap will come pre-installed:

Bootstrap in starter template solution view

Adding Bootstrap to an ASP.NET Core project is simply a matter of adding it to bower.json as a dependency:

JSONCopy
{  "name": "asp.net",  "private": true,  "dependencies": { "bootstrap": "3.3.6", "jquery": "2.2.0", "jquery-validation": "1.14.0", "jquery-validation-unobtrusive": "3.2.6" } }

This is the recommended way to add Bootstrap to an ASP.NET Core project.

You can also install bootstrap using one of several package managers, such as Bower, npm, or NuGet. In each case, the process is essentially the same:

Bower

consoleCopy
bower install bootstrap

npm

consoleCopy
npm install bootstrap

NuGet

consoleCopy
Install-Package bootstrap

Note

The recommended way to install client-side dependencies like Bootstrap in ASP.NET Core is via Bower (using bower.json, as shown above). The use of npm/NuGet are shown to demonstrate how easily Bootstrap can be added to other kinds of web applications, including earlier versions of ASP.NET.

If you're referencing your own local versions of Bootstrap, you'll need to reference them in any pages that will use it. In production you should reference bootstrap using a CDN. In the default ASP.NET site template, the _Layout.cshtml file does so like this:

HTMLCopy
 
@ViewData["Title"] - WebApplication1
@RenderBody()

© 2016 - WebApplication1

转载于:https://www.cnblogs.com/freeliver54/p/9261963.html

你可能感兴趣的文章
CentOS 6.5克隆后eth1与eth0的问题
查看>>
[国家集训队]小Z的袜子 | 普通莫队
查看>>
企业信息系统——SCM
查看>>
ESXI6.0 时间(时区)显示不一致
查看>>
流程控制 while循环 运算符
查看>>
go时间和日期
查看>>
Collection中的List,Set的toString()方法
查看>>
mysql中You can’t specify target table for update in FROM clause错误解决方法
查看>>
Iterator --迭代器
查看>>
根据两点的经纬度计算两地距离
查看>>
向webabcd先生致敬!
查看>>
拉格朗日乘子法与KKT条件 && SVM中为什么要用对偶问题
查看>>
【转】好的用户界面-界面设计的一些技巧
查看>>
IDEA+Tomcat热部署自动编译
查看>>
Xcode里-ObjC, -all_load, -force_load
查看>>
Block的引用循环问题 (ARC & non-ARC)
查看>>
详解Ubuntu16.04安装Python3.7及其pip3并切换为默认版本(转)
查看>>
POJ 2777 Count Color
查看>>
51nod 1135 原根
查看>>
HTML5在客户端存储数据的新方法——localStorage
查看>>