Home › Forums › WoodMart support forum › Align footer content to center on mobile only
Align footer content to center on mobile only
- This topic has 15 replies, 2 voices, and was last updated 2 years, 11 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
January 21, 2022 at 10:37 am #346947
horny_fungusParticipantHi, I am using HTML block for footer and I want to align its content to center but for mobile only. How I can achieve this?
January 21, 2022 at 12:11 pm #346966
Aizaz Imtiaz AwanKeymasterHello,
Please try adding the following Custom CSS in the Custom CSS for Mobile area under Theme Settings >> Custom CSS.
.footer-container .wd-sub-menu li a { text-align: center; display: block; }
Best Regards
January 21, 2022 at 3:35 pm #347013
horny_fungusParticipantThanks a lot, that worked. Can you also please tell me how I can align to center particular button element on mobile if whole column is aligned to left by default?
January 22, 2022 at 6:14 am #347089
Aizaz Imtiaz AwanKeymasterHello,
You are Most Welcome.
You can assign a separate class to the button by editing the element.
Screenshot for Clarification: https://ibb.co/1Xh4ccw
Then by targeting the class you can align the button as you require.
Best Regards
January 22, 2022 at 8:20 am #347110
horny_fungusParticipantI tried applying different CSS (e.g. text-align) properties this way, but I can’t influence button alignment.
Can you please suggest to me the proper CSS?January 22, 2022 at 8:43 am #347111
Aizaz Imtiaz AwanKeymasterHello,
Please assign a class to the button and provide the URL to check it myself and help you out accordingly.
Best Regards
January 22, 2022 at 8:56 am #347114
horny_fungusParticipantOK. The button in question is on the home page right before the footer with “learn more” text.
January 22, 2022 at 10:52 am #347131
Aizaz Imtiaz AwanKeymasterHello,
Please try adding the following Custom CSS in the Custom CSS for Mobile area under Theme Settings >> Custom CSS.
.mcbr-centered { margin-left: 99px; margin-right: 99px; }
Best Regards
January 22, 2022 at 11:07 am #347135
horny_fungusParticipantThanks, it works but there are two problems:
1) button becomes too narrow
2) footer is affected, right padding for footer background image is upper than it should beJanuary 22, 2022 at 12:12 pm #347145
Aizaz Imtiaz AwanKeymasterHello,
Please try adjusting the margin values as you need. Then check back.
Best Regards
January 22, 2022 at 12:31 pm #347150
horny_fungusParticipantIt looks like
margin-right
does nothing, onlymargin-left
affects placement.
And such way to center element seems non-reliable because smartphone screens have different resolutions and element position will vary depending on the resolution.January 22, 2022 at 12:46 pm #347152
Aizaz Imtiaz AwanKeymasterHello,
Sorry but this is how it could be aligned to the centre using CSS.
You can try creating a separate column for mobile and set the button to display centre and hide the column for Desktop.
Screenshot for Clarification: https://ibb.co/QbwHhhX
Best Regards
January 22, 2022 at 1:07 pm #347157
horny_fungusParticipantI was able to achieve proper result applying “text-align:center” to the whole column in mobile css, for some reason this affects only button, previous rows are still aligned to left just as I need.
January 24, 2022 at 6:54 am #347357
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the screenshot of the issue, where the CSS is not apply on mobile in the homepage?
Best Regards.
January 24, 2022 at 8:21 am #347380
horny_fungusParticipantI am happy with the result. I just don’t understand why when I apply
text-align:center
directly to button nothing changes and when I applytext-align:center
to the whole column button is centered as expected, but other elements are aligned to left.
You can check this on my home page.
Once again this layout is what I want, I just don’t understand why CSS works this way here.January 24, 2022 at 11:56 am #347468
Aizaz Imtiaz AwanKeymasterHello,
I think you are not using the correct Classes for the button and applying the CSS to the wrong button class. At this time you have applied the custom CSS to the correct class that is why it is working fine.
Best Regards.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register