Jump to content

Display icon and text on the same line using code block

Recommended Posts

I have this portion of the page that looks amazing on desktop, but once i view the mobile version, it's messed up. 

desktop version:
mobile version:

i use code block for the icons (icons from Font Awesome) while and text for the text.

an example of my font code is : <i class="fas fa-street-view fa-4x"></i>

im trying to change and make my icon and text inline, so that for mobile version an icon + text will be on 1 line.
i am new to coding and thus i try:
<i class="fas fa-street-view fa-4x"></i><h3>18years old and above</h3>

but the icon and text are on different lines...


how can i code it so that it will look like this on mobile too?
align to left but the icon and text should align horizontally too..

Edited by JamieC
Link to comment
15 hours ago, tuanphan said:

Add to Home > Design > Custom CSS

@media screen and (max-width:640px) {
div#block-yui_3_17_2_1_1593682388012_80440+.row>.col>.row {
    display: flex;
    width: 100%;


Hi Tuanphan, thanks for the code, it works! My icons and text are now on the same line, however they are not aligned currently. This is how it looks like now on mobile version.

Is there any way i can do to make the icons align centrally and the text all align to the left? So it will look something like this:

Link to comment
  • 5 months later...

If it helps for anyone who finds this question later, I found a second fairly simple solution, though a bit more annoying if you're handing the site off to a client.

 I added my text into the code block that has the Font Awesome Icon and html styled it within there with spaces and line breaks, and was able to get it even with that.



Link to comment
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.