Gulafsan Shaheen
Published in : 2022-03-04
I am working with the following template:
<ul><li > <img ....></li>
I am trying to align this list item in the center of the UL, I don't have access to changes of style for the ul, because the class show-large-preview on the li is conditionally added, so seeing display table won't work here.
Any ideas?
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Shilpa Date : 2022-03-04
Best answers
10
Best answers
10
You need to set a fixed width or a container first and after that,
on your ul for `margin-right:auto` and `margin-left:auto`.
You can also set CSS property to your class to align items in the center.
Hope it works as expected for you.
Gulafsan Shaheen Date : 2022-03-05
Best answers
1
Best answers
1
Thank you so much!