Css Bootstrap don';不要让我坐在中间
我正在使用mvc5与razor viewengine和引导 当我使用bootstrap.css中心时,我想让一些图像居中,但当我删除bootstrap.css时,它工作正常。我使用了bootsrtapCss Bootstrap don';不要让我坐在中间,css,twitter-bootstrap,center,Css,Twitter Bootstrap,Center,我正在使用mvc5与razor viewengine和引导 当我使用bootstrap.css中心时,我想让一些图像居中,但当我删除bootstrap.css时,它工作正常。我使用了bootsrtap文本中心类,但它也不起作用:/ 使用.img responsive{margin:0px auto}可能对您有用尝试添加显示:块;边距:10px自动到样式属性。这将使div图像居中。我已经更新了用于演示的JSFIDLE @商品名称 @item.GoodSubText Ps.还将高度从高度:390
文本中心类
,但它也不起作用:/
使用
.img responsive{margin:0px auto}
可能对您有用尝试添加显示:块;边距:10px自动
到样式
属性。这将使div
图像居中。我已经更新了用于演示的JSFIDLE
@商品名称
@item.GoodSubText
Ps.还将
高度
从高度:390px
更改为高度:自动
,以避免图像拉伸。将图像标签更改为:
<img style="width:450px ; height:390px; display: inline" class="img-responsive" src="http://images.all-free-download.com/images/graphiclarge/daisy_pollen_flower_220533.jpg" />
请注意,我添加了:
display:inline
还有另一种方法:
在图像中包括class=“中心块”,如下所示:
<img .. class="img-responsive center-block" src="http://images.all-free-download.com/images/graphiclarge/daisy_pollen_flower_220533.jpg" />
检查小提琴:你知道吗,我自己测试过,但不起作用,但它起作用了,真丢脸,谢谢你
<img .. class="img-responsive center-block" src="http://images.all-free-download.com/images/graphiclarge/daisy_pollen_flower_220533.jpg" />