[英]ASP.NET:How to make webform mobile responsive?
我有ASP.NET项目。我希望它在设备被检测为移动或桌面时自动更改其视图。可用的方法是什么?请建议一些示例项目。我尝试了很多tutos。但我仍然无法抓住它们。任何人都可以建议一步一步的方法吗?
使您的网页按设备响应
- >首先你需要在你的项目中有引导程序。
- >你的bootstap.css
文件中有container
( assets - > css - > bootstap.css )。
- > container
将具有默认声明的不同类型的屏幕类型
示例 :
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
- >你必须在你的cs文件中使用这些容器。在asp.net中它是.aspx extention file.for
例:
<div class="below-slideshow" style="padding-bottom: 0px">
<div class="container"> <!-- NOTICE HERE:inside div declare class as container/container-fluid-->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div>
<h1 class="head-line">Dashboard</h1>
</div>
</div>
</div>
</div>
</div>
- >了解有关容器和容器液的更多信息http://www.w3schools.com/bootstrap/bootstrap_get_started.asp
快乐的编码:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.