Tagged: x
-
AuthorPosts
-
August 28, 2016 at 4:37 pm #1150802
ButtermeltsParticipantHello,
I think I have a good idea of how to vertically align content within a row or column, but how can I vertically align the row itself so it is in the middle of a section? For example, I set the height of a section to 100vh and placed a row within the section. I can set images and text within the row to vertically align to the middle of the row, but how can I place the row itself into the middle of the section?
Is there any way to do this so it is dynamic no matter what size window or from which device I am viewing? I’m aware that you can use gaps to simulate this, but it’s not a robust solution. How do I accomplish this if there are multiple rows in a section so that all content is vertically aligned to the middle of a section?
August 28, 2016 at 4:40 pm #1150806
ButtermeltsParticipantThis reply has been marked as private.August 28, 2016 at 7:14 pm #1150907
RadModeratorHi there,
Thanks for posting in.
Could be done like this,
#x-section-2 { min-height: 70vh; line-height: calc(70vh - 200px); } #x-section-2 > .x-container { line-height: normal; display: inline-block; vertical-align: middle; }Where 200px is the total padding of your #x-section-2’s top and bottom.
Hope this helps.
August 28, 2016 at 7:32 pm #1150914
ButtermeltsParticipantCan you tell me how to do that with #x-section-1? Just changing #x-section-2 to #x-section-1, 70vh to 100vh, and the 200px to 90 px (total top and bottom padding of the section) doesn’t have the desired results.
August 28, 2016 at 8:41 pm #1151058
RadModeratorHi there,
Sure, please add this as well,
#x-section-1 { min-height: 100vh; line-height: calc(100vh - 90px); } #x-section-1 > .x-container { line-height: normal; display: inline-block; vertical-align: middle; }And make sure that margin less column is turned off.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1150802 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
