html - divs are not horizantal bootstrap
问题描述
I want to make 3 columns horizontal and ı use col-md-12 for main column and for child columns col-md-4 but my row have only one columns and sub divs are vertical.My english not good enough but please help me.All divs are under other div and all divs are left side of page.I try my html in other project this is worked but in this projecy one thing corrupted my grid system but ı cant find it.
This is my nested Layout
@model HomeViewModel
@*@{
ViewData["Title"] = "News";
}*@
@section PageTitle{
etwyrjs
}
@section PageDesc{
etwyrjs
}
@*<div class="col-md-12">
<h2>News</h2>
</div>*@
@foreach (var pie in Model.Pies)
{
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="@pie.ImageThumbnailUrl" alt="" />
<div class="caption">
<h3 class="pull-right">@pie.Price.ToString("c")</h3>
<h3>
<a asp-controller="Home" asp-action="Details"
asp-route-id="@pie.Id">@pie.Name</a>
</h3>
<p>@pie.ShortDescription</p>
</div>
</div>
</div>
}
This is my nested Layout.
@{
ViewData["Title"] = "LayoutForOthers";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="row">
<div class="col-md-12">
<img src="~/images/büyük foto-1.png" alt="Snow" style="width:100%;">
@*<div class="bottom-left">
</div>*@
<div class="top-left">
<h1 style="text-align:left; color:white">@RenderSection("PageTitle")</h1>
<br />
<br />
<p style="text-align:left; color:white;">@RenderSection("PageDesc") Dijital sağlık alanında dünyanın önde gelen isimlerinden olan ve İngiltere'nin en büyük sağlık teknolojisi topluluğu Health 2.0 London'ı kuran Maneesh Juneja, yapay zekanın geleceği hakkında önemli açıklamalarda bulundu. Kendisini ''dijital sağlık fütüristi'' olarak nitelendiren Juneja, geçtiğimiz hafta İstanbul'da katıldığı etkinlikte yapay zeka ile ilgili soruları yanıtlarken 2040 yılının önemli bir dönüm noktası olabileceğini işaret etti.</p>
</div>
@*<div class="top-right">Top Right</div>
<div class="bottom-right">Bottom Right</div>
<div class="centered">Centered</div>*@
</div>
</div>
<div class="row">
<div class="col-md-12">
@RenderBody()
</div>
</div>
This is from my main layout.
<div class="col-md-12">
@RenderBody()
</div>
解决方案
你在寻找这样的东西吗?无论您的 Bootstrap 版本是什么,这都应该有效。(全屏打开)
<!-- Include this in your <head> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="row">
<div class="col-sm-12 bg-primary">
<!-- This is you full width column -->
<p>This is you full width column</p>
</div>
<div class="row">
<div class="col-sm-4 bg-danger">
<!-- This is 1/3 columns -->
<p>Column 1</p>
</div>
<div class="col-sm-4 bg-info">
<!-- This is 2/3 columns -->
<p>Column 2</p>
</div>
<div class="col-sm-4 bg-success">
<!-- This is 3/3 columns -->
<p>Column 3</p>
</div>
</div>
</div>
推荐阅读
- jsp - JSP不保持缩进
堵塞
- php - 只需获取数字到数字表即可在联系人列表中查看
- rtsp - “参见 [H4.3]”在 RFC 中是什么意思?
- performance - 为什么这个睡眠功能比它应该花费的时间长得多?
- apache-spark - 我们可以从 Spark 的 StructType 为 Hive 创建一个 avsc 文件吗?
- python - 导入 Scipy.io 时出错我正在使用 python 3.5.0 这个错误出来了
- python - 如何使用 Python 替换 PE 文件中的指令?
- reactjs - 按类别和关键字过滤数组
- python - 将 json 文件传递给无服务器 lambda
- sql-server - 为 SQL Server 的 ODBC 驱动程序 17 配置字符集