为什么我的图像不会使用Bootstrap中心?(Why won't my images center using Bootstrap?)

编程入门 行业动态 更新时间:2024-10-23 20:30:58
为什么我的图像不会使用Bootstrap中心?(Why won't my images center using Bootstrap?)

我是html / css的新手,我正在尝试创建一个直接的网页,这只是几个水平居中的图像,每个都在自己的行上。 我最终使用了Bootstrap的基本html模板,并且无法弄清楚下面的代码有什么问题。 我的图像卡在页面的左边缘。 我目前使用的唯一CSS是默认链接的:“css / bootstrap.min.css”

这就是我身上的所有内容:

<div class=“container-fluid”> <div class=“row”> <img src="..." class=“img-responsive center-block”> </div> <div class=“row”> <img src="..." class=“img-responsive center-block”> </div> </div>

I'm new to html/css and am trying to make a straight-forward webpage, which is just several images centered horizontally, each on their own row. I ended up using Bootstrap's basic html template, and can't figure out what's wrong with the code below. My images are stuck on the left edge of the page. The only CSS I'm currently using is the default linked one: "css/bootstrap.min.css"

This is all that's currently in my body:

<div class=“container-fluid”> <div class=“row”> <img src="..." class=“img-responsive center-block”> </div> <div class=“row”> <img src="..." class=“img-responsive center-block”> </div> </div>

最满意答案

您的引号(“”)似乎在您的img类中被破坏了。 不知道你实际使用了什么,但将它们改为正常的引号,它应该工作。

<div class="container-fluid"> <div class="row"> <img src="..." class="img-responsive center-block"> </div> <div class="row"> <img src="..." class="img-responsive center-block"> </div> </div>

Your quotation marks ("") seem to be broken in your img's class. Don't know what your actually using but change them to normal quotation marks and it should work.

<div class="container-fluid"> <div class="row"> <img src="..." class="img-responsive center-block"> </div> <div class="row"> <img src="..." class="img-responsive center-block"> </div> </div>

更多推荐

本文发布于:2023-08-07 17:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465104.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   中心   center   Bootstrap   images

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!