Position element in the middle of the screen

Asked

Viewed 128 times

-2

I tried to adjust an element (sliders) in the middle of the screen, but I couldn’t do it:

inserir a descrição da imagem aqui

Meo aims to leave this image always in the center, right, no matter the monitor being used by another user. That is, the smaller and larger part should be of the same height, in all situations.

Follow the code I used:

.img-responsive, .thumbnail>img, .thumbnail a>img, .carousel- 
inner>.item>img, .carousel-inner>.item>a>img {
display: block;
max-width: 100%;
max-height: 100%; 
height: auto;
position: relative;
}

I use the language R along with Rmarkdown to do this.

  • Which properties would solve this problem?
  • 1

    Friend explains there, how do you want that does not cut this image, but that it occupies the whole screen? You want it to be distorted even, flattened type https://prnt.sc/qx0jo1 and this space you no longer checked if there is any type of margin or padding in this container that the slider is inside?

  • Forget the "cut" part. How would I just adjust the figure to the center? I’m sorry, I don’t understand CSS and I just took this code from the document that was generated.

  • I can’t do this, even with this question you sent me and the answers. If you have time available, I can upload the file and you can access it from your computer and see this code better. I don’t know about CSS, and I don’t want you to do the work for me, but maybe the problem isn’t even in this part of CSS, and I can’t identify where I can put the code.

  • Note: You put the maximum height as 100%, IE, it will always enter with 100% of the screen, I imagine that’s your problem

1 answer

-1

In the parent container that is the slide put the property css margin: 0 auto! Mportant; if n resolve remove and put display:flex! Mportant; Justify-content: center! Mportant;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.