I need you kind help please. My website is tripmagics.com
There is problem of top margin in mobile. In mobile top heading about us is hiding behind top menu. In desktop/laptop its ok. https://tripmagics.com/about-us
And also if you go to destination in top menu in mobile its not scrolling down, it’s stuck. In desktop its ok.
Kindly tell in which file/css etc I need to add which code or line of code
Really appreciate. I thank you in advance. Good day
The problem is that you are looking only at your own screen width/height and not anyone else’s. It all depends on the size of the screen as to whether the items are broken or not. Nothing to do with mobile as such except that they have smaller screens.
The issue with the drop menu is that you have a position:fixed nav and anything that goes below the viewport bottom cannot be reached unless the fixed element is contained within the viewport and has a scroll mechanism enabled.
The missing heading that goes under the menu is a similar issue in that fixed elements are removed from the flow and therefore any other content is obscured by them.
In your page you put 2 empty p tags to create space (never do that) but as your top menu wraps that space is not enough to show the heading.
I suggest that instead of position:fixed you use position:sticky instead which will preserve the initial space and then you can remove the 2 empty p tags from the html.
Then you can enable a max-height of the viewport height and set the overflow to auto.
Now the item will scroll and the header won’t be obscured.
You really should use some media queries and adjust that heading on smaller screen size. You are currently allowing it to wrap to 2 lines which looks awkward and almost fills half my mobile screen before you start and obscures most of the content.
OK, It’s actually working but its going behind the map. There’s a bit of a catch22 going on with this menu.
Before I get too deep in changinging everything can you try this first? Bootstrap has a default sticky menu and if you change the class in the html to sticky-top it may be set up to work already without extra css.
e.g.
<nav class="sticky-top">
It won’t be perfect but on testing it seems to allow the mobile menu to scroll (although you need to scroll at the edge of the phone).
To be honest that nav design is not really made for small screen and I would have put the search bar, and nav menu all in a slider that slides in from the side and fills the page. You would just make the hamburger button sticky (or fixed positioned at the top).
It is scrollable on my iPhone but is a bit awkward as I mentioned due to the menu blocking the page scroll. This is an issue for all scrollable elements on mobile which is why you have to code specifically to avoid this.
Try that and see if it’s getting closer. The code above should only take effect once the hamburger menu is present. (No guarantees though ;))
Also note that the extra space you were talking about is because you have inserted numerous breaks. e.g.
<br><br><br> <br>
<div class="slider etc...
They are not needed now that position:sticky is being used so you will have to manually remove them.
OFF - TOPIC Note that in most pages you will rarely need to use a break (<br>) because they are only meant to create a new line in structures like an address or a poem or between form elements (although there are better ways than that). Breaks are a structural element and never meant to create space as such (indeed in older browsers two breaks in a row were sometimes collapsed into one break only anyway).
Making space between elements is the job of margins and padding and can usually be done without adding extra elements.
I removed the breaks and empty p tag from the html in the codepen. You should be able to fork (or copy) the codepen so that you can test more easily. I will remove the codepen in a couple of days.