I am writing my first website, here, www.shegoesplacesandseesthings.com. When viewed on a small screen, the top navigation menu becomes a little icon instead, an 'svg viewBox', which can be clicked on to open the menu. This works fine with a mouse on a laptop and even on an iPad, the icon is clickable. However on an iPhone screen, the menu resizes to the icon, but is not clickable. I'm writing only in html and css (I've just started learning).
My question is, is it possible to make the icon clickable on an iPhone? I understand that media queries can be used for resizing web pages for different sized screens, or do I need to use Javascript?
Here is the html and css code that sets up the menu bar.
<nav class="site-nav">
<span class="menu-icon">
<svg viewBox="0 0 18 15" width="18px" height="15px">
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
</svg>
</span>
<div class="trigger">
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endfor %}
</div>
</nav>
.site-nav {
float: right;
line-height: 56px;
.menu-icon {
display: none;
}
@include media-query($on-palm) {
position: absolute;
top: 9px;
right: $spacing-unit / 2;
background-color: $background-color;
border: 1px solid $grey-color-light;
border-radius: 5px;
text-align: right;
.menu-icon {
display: block;
float: right;
width: 36px;
height: 26px;
line-height: 0;
padding-top: 10px;
text-align: center;
> svg path {
fill: $grey-color-dark;
}
}
.trigger {
clear: both;
display: none;
}
&:hover .trigger {
display: block;
padding-bottom: 5px;
}