different layout for menu on mobile
alexsavu
Registered Users Posts: 4 Big grins
Hey
This is my website I'm currently working on: https://www.alexsavu.com. I have a menu on my home page that I would like to have a different layout on mobile. This is my CSS code for it:
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-horizontal .sm-page-widget-nav-toplink {
padding-right: 5%;
padding-left: 5%;
line-height: 76px;
}
.sm-user-ui .sm-page-layout-region-center .sm-page-widget-nav-toplink a {
color: #ffffff;
#font-size: 62px;
font-size: 300%;
letter-spacing: 12px;
text-shadow: 4px 3px rgba(0,0,0,0.1);
}
.sm-page-widget-nav .sm-page-widget-nav-mobile-items-visible .sm-page-widget-nav-items {
color: #ffffff;
font-size: 100%;
letter-spacing: 12px;
text-shadow: 4px 3px rgba(0,0,0,0.1);
}
.sm-user-ui .sm-page-widget-nav-toplink a:hover {
color: #dcdcdc;
}
.sm-user-ui .sm-page-widget-nav-toplink a {
-webkit-transition: all 0.2s ease-in;
transition: all .2 ease-in;
}
As you can see, besides the mobile part, what it basically does is some padding, some basic color and sizing for the text and effect for the hover. What I would want to achieve is have a vertical layout on mobile (in my case it is vertical just because the screen is not wide enough) and have it centered (picture attached). this would most likely eliminate the bottom scroll bar as well. I'm just not sure which objects I can use in the CSS code to manipulate the menu (or navigation bar. not sure how it's called). I hoped that smugmug would automatically take care of it and make the whole website mobile friendly.
I know about this post https://www.aaronmphotography.com/Customizations/Sitewide/Screen-Width-Customizations but here it only shows which tags to use to make specific customizations for different screens. I only really want to have the same thing as I already have on big screens.
Any help would be really appreciated. Thanks.
This is my website I'm currently working on: https://www.alexsavu.com. I have a menu on my home page that I would like to have a different layout on mobile. This is my CSS code for it:
.sm-user-ui .sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-horizontal .sm-page-widget-nav-toplink {
padding-right: 5%;
padding-left: 5%;
line-height: 76px;
}
.sm-user-ui .sm-page-layout-region-center .sm-page-widget-nav-toplink a {
color: #ffffff;
#font-size: 62px;
font-size: 300%;
letter-spacing: 12px;
text-shadow: 4px 3px rgba(0,0,0,0.1);
}
.sm-page-widget-nav .sm-page-widget-nav-mobile-items-visible .sm-page-widget-nav-items {
color: #ffffff;
font-size: 100%;
letter-spacing: 12px;
text-shadow: 4px 3px rgba(0,0,0,0.1);
}
.sm-user-ui .sm-page-widget-nav-toplink a:hover {
color: #dcdcdc;
}
.sm-user-ui .sm-page-widget-nav-toplink a {
-webkit-transition: all 0.2s ease-in;
transition: all .2 ease-in;
}
As you can see, besides the mobile part, what it basically does is some padding, some basic color and sizing for the text and effect for the hover. What I would want to achieve is have a vertical layout on mobile (in my case it is vertical just because the screen is not wide enough) and have it centered (picture attached). this would most likely eliminate the bottom scroll bar as well. I'm just not sure which objects I can use in the CSS code to manipulate the menu (or navigation bar. not sure how it's called). I hoped that smugmug would automatically take care of it and make the whole website mobile friendly.
I know about this post https://www.aaronmphotography.com/Customizations/Sitewide/Screen-Width-Customizations but here it only shows which tags to use to make specific customizations for different screens. I only really want to have the same thing as I already have on big screens.
Any help would be really appreciated. Thanks.
0
Comments
If I understand your question, you want the menu text to get smaller when you switch to smaller devices, correct? Remove that code and use this:
It's pretty much the same thing, but when the screen switches to
736px
or smaller, the text gets smaller and changes the color. You can see that on the@media
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
The code I posted should work. I guess I don't understand your question.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
,
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I thought you wanted the text to change color with mobile devices. My bad. This will shrink the nav text from 300% to 100% when the screen is 736px or smaller and the text color will be white.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Thank you for your patience @Hikin' Mike . This seems to work much better. Actually I had to combine my original code with the mobile only bit from your last comment. If I would copy the entire code from your last comment it would render one of the buttons with black and the other with white. Very strange behaviour. Thanks again