Mobile Alignment: Self Updating Footer Date
I have the following setup:
<p style="font-size:14px; color: #9ea8b2; text-align: left; font-family: red hat text, sans-serif!important;">
Copyright © <span id="copyright-year">2020</span> - Website Name
<script>
document.querySelector('#copyright-year').innerText = new Date().getFullYear();
</script></p>
How to align for center in mobile view easiliy?
Left desktop, center mobile.
0
-
Hi Ray,
You can use the following CSS to center the copyright text on mobile devices:
/* Center the copyright text on mobile */
@media (max-width: 767px) {
#copyright-year {
display: inline;
}
p {
text-align: center !important;
}
}
You can add this CSS in Brizy Cloud by going to:CMS -> Project Settings -> Code -> Custom CSS
After adding the CSS, save and publish the project for the changes to take effect.
Screencast - https://youtu.be/TF7jn3dBe8g0 -
Aha! Brilliant!
Thank you.
Also, an alternative placement in the WordPress menu: Appearance > Customise > Additional CSS
0 -
Hi Ray,
You're welcome! Yes, that also works perfectly on WordPress.
0
Please sign in to leave a comment.
Comments
3 comments