Jump to content

Is There A Way To Make This CSS Mobile Friendly?

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Is there. a way to use make this code mobile friendly with CSS?

As in, make the folder title a link to another page and then have another page under it for a dropdown menu.

 

div.header-nav-folder-content {
	margin-top: -1.5rem;}

 

.header-nav-folder-item:first-of-type a {
	opacity: 0;}

Here is my website

https://www.erinncapko.com/

  • Replies 3
  • Views 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted
17 hours ago, tuanphan said:

Mobile friendly - What do you mean?

As in, is there a way to make the folder header covered by a link and then have  a page underneath, much like the web version of my website with CSS?

  • Solution
Posted

You can add this code to Website Tools (under Not Linked) > Code Injection > Footer (DO NOT add to Custom CSS)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$('.header-menu-nav-folder[data-folder="/surface-design"]').appendTo('[data-folder="root"]>div>div>.container.header-menu-nav-item:nth-child(2)');
		$('a[data-folder-id="/surface-design"]').click(function() {
  $(this).toggleClass('tp-burger-folder');
});
});
</script>
<style>
  .header-menu-nav-folder[data-folder="/surface-design"] {
    display: block !important;
    position: relative !important;
    transform: unset !important;
    overflow: hidden;
    height: auto !important;
    transition: all 0.3s;
}
.header-menu-nav-folder[data-folder="/surface-design"] .header-menu-controls {
    display: none;
}
a.tp-burger-folder+.header-menu-nav-folder[data-folder="/surface-design"] {
    height: 100% !important;
}
.header-menu-nav-folder[data-folder="root"] {
    transform: unset !important;
    overflow: hidden;
}
[data-folder="/surface-design"] a {
    margin-top: 5px;
    margin-bottom: 5px;
    white-space: nowrap;
}
[data-folder-id] {
    margin-top: 10px;
    margin-bottom: 10px !important;
}
  a[data-folder-id] span:nth-child(2):after {
    content: "\e009";
    font-family: 'squarespace-ui-font';
}

a[data-folder-id] {
    white-space: nowrap;
}
</style>

image.thumb.png.bd34f9b5a6968bbd09a16d8aa518af38.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.