Boostrap 4 img-responsive不能完全发挥作用

时间:2017-08-25 15:27:33

标签: html5 css3 bootstrap-4

自从bootstrap 4问世以来,我正在使用它。

我看到你不能使用。

class="img-responsive"

所以我用过这个:

.img-fluid{
max-width: 100%;
height: auto;

但它不能完全发挥作用,因为当我屏幕的一半它只是img-fluid, 有没有办法让它像img-responsive一样工作,还是需要修复?

映入眼帘,

柯南

3 个答案:

答案 0 :(得分:1)

在Bootstrap 4中,.img-responsive更改为.img-fluid。有关从BS3迁移到BS4的更多信息,请访问此link

答案 1 :(得分:0)

您可以添加此类card-img-top

HTML

<img src="your images link" class="card-img-top" alt="...">

CSS

img {
  height: auto;
  max-width: 100%; }

答案 2 :(得分:0)

我使用 myConnection.Open() Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM PatientDB", myConnection) Dim adpt As New OleDbDataAdapter(cmd) Dim tbl As New DataTable() adpt.Fill(tbl) TxtPatient.DataSource = tbl TxtPatient.DisplayMember = "LastName" TxtPatient.ValueMember = "PatientID" myConnection.Close() ,它工作正常。

当我最小化屏幕时,图像也会自动最小化(随父元素缩放)。

也许您可以发布一些代码,以便我们更好地了解您的问题?