Robin Ryden
Robin Ryden

Reputation: 1

Bootstrap Carousel, with choosen height

I am trying to set a height on my carousel in bootstrap. If I set the height to 700px, the carousel looks like crap in responsive. So how do I fix this such that my carousel looks good on the desktop and smartphone etc.? What should be the appropriate height?

Upvotes: 0

Views: 278

Answers (2)

G.L.P
G.L.P

Reputation: 7217

You can try vh and vw for viewport height and width

.class{ 
  width: 50vw; 
  height: 50vh;       
}

With vw/vh, we can size elements to be relative to the size of the viewport. The vw/vh units are interesting in that 1 unit reflects 1/100th the width of the viewport. To make an element the full width of the viewport, for example, you'd set it to width:100vw.

For more info refer this link

1vw = 1% of viewport width
1vh = 1% of viewport height
1vmin = 1vw or 1vh, whichever is smaller
1vmax = 1vw or 1vh, whichever is larger

Upvotes: 1

Luis
Luis

Reputation: 56

Maybe you should try to use percent instead a fixed height, for instance 40%.

Upvotes: 0

Related Questions