1
I have a father div that has the scroll enabled and a width limit, below it I have another div with content.
My wish is to center this content on the parent div so that the content is centralized, note:
<div class="scroll">
<div class="content">
00000000000000000111000000000000000000
</div>
</div>
.scroll {
overflow:auto;
width: 100px;
background-color:black;
}
.content {
background-color:red;
display:inline-block;
}
https://jsfiddle.net/b1unhL34/
That way only the 0
but in a centralized way the 1
also.
Are there any tricks in CSS or jQuery/Javascript to accomplish this?
An interesting way to center div’s against others is by using flexbox: http://www.devmedia.com.br/como-centralizar-divs-em-html-e-css/37568?utm_source=browser&utm_medium=push_notification&utm_campaign=PushCrew_notification_1483020272&pushcrew_powered
– Henrique Schmitt