Wie passe ich das Bild entsprechend der Breite und Höhe in die Bootstrap-Karte ein?HTML

HTML-Programmierer
Anonymous
 Wie passe ich das Bild entsprechend der Breite und Höhe in die Bootstrap-Karte ein?

Post by Anonymous »

Ich möchte die Bildbreite und -höhe (300px;300px;) in der Karte angeben:

Code: Select all


[img]/demo/img/1.jpeg[/img]

Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
[url=#]Go somewhere[/url]



Die Ausgabe wurde verkleinert:
Image

Wenn ich die folgende Codezeile entferne, ist das Bild so lang, wird aber nicht verkleinert:

Code: Select all

style="width:35rem;height:20rem;"
Ich habe versucht:

Code: Select all

object-fit:cover;(Check all properties like fill, scale-down)
Habe auch etwas CSS ausprobiert:

Code: Select all

.clsAutofit{
height:300px;
width:300px;
}
.clsImg{
max-width:100%;
max-height:100%;
}


[img]/demo/img/1.jpeg[/img]


Ich habe auch einige Eigenschaften ausprobiert:

Code: Select all

img.one {
display: block;
object-fit: contain;
max-width:500px;
max-height:280px;
width: auto;
height: auto;
}

img.two {
object-fit: contain;
width: 535px;;
height: 535px;
}
.box {
width: 30%;
height: 200px;
border: 5px dashed #f7a239;
}
.containerTY {
width: 60%;
height: 500px;
}
.containerTYZ {
max-width: 100%;
}
.thumbnail {
width: 500px;
height: 400px;
}
.img4R {
width: 100%;
height: auto;
max-width: 50vw;
}

Ich habe es versucht, habe es aber noch nicht geschafft.
Jede Idee oder jeder Vorschlag wäre willkommen.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post