Convert Menu to responsive

I inherited a section of a web site that is presented as fixed width. There are two pieces, I think I can manage all except a top menu by using % as widths rather than absolute pixels.

The "menu" part consists of a fixed image (attached) and an image map, as follows:

<map name="head">
      <area shape="rect" coords="611,21,783,38" href="http://www.rainrich.com/scheduling/index.php">
      <area shape="rect" coords="28,24,75,40" href="http://www.rainrich.com/home">
      <area shape="rect" coords="97,24,161,42" href="http://www.rainrich.com/services">
      <area shape="rect" coords="182,24,253,40" href="http://www.rainrich.com/about-us">
      <area shape="rect" coords="277,24,331,40" href="http://blog2.rainrich.com">
      <area shape="rect" coords="352,24,482,40" href="http://www.rainrich.com/online-payments">
      <area shape="rect" coords="502,24,590,40" href="http://www.rainrich.com/contact-form">
</map>      

and:
<img src="images/header.png" width="909" height="159" usemap="#head" border="0">

I don't need to EXACTLY replicate the image, I could probably just have a green background & the menu items listed horizontally.

What is the quickest & easiest was to make the menu portion responsive, meaning will display proportionally on smart phones & tablets?

Thanks
header.png
Richard KortsBusiness Owner / Chief DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
You won't be able to use the image map because a it scales down the coordinates won't be correct.
I'd add a second responsive menu that only appears below a certain resolution, i.e.the width of the image. If the screen is wider, site the image map, smaller, then show the new responsive menu.
You can do that with css media queries
So assuming you have a div to encapsulate your original menu, with a class "menu1" and your new responsive menu has the class "menu-responsive"
@media screen (min-width: 909px) {
    div.menu1 {
        display: block;
    }
    div.menu-responsive {
        display: none;
    }
}
@media screen (max-width: 908px) {
    div.menu1 {
        display: none;
    }
    div.menu-responsive {
        display: block;
    }
}

Open in new window


<div class="menu 1">
<map>...</map>
<img ... />
</div>
<div class="menu-responsive">
<ul>
<li>...</li>
...
</ul>
</div>

Open in new window

Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
Thanks, I think I did what you said, must have done something wrong.

If shows both menus (on a normal PC screen).

See http://rkassoc.org/Rainrich/menu_test.html.

html attached.

Thanks
menu-test.html
Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
To Rob Jurd

I attached the wrong version, I fixed it, still the same.

See attached
menu-test.html
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

RobOwner (Aidellio)Commented:
Sorry, I forgot the "and" in the media query

@media screen and (max-width: ...)

@media screen and (min-width: 909px) {
    div.menu1 {
        display: block;
    }
    div.menu-responsive {
        display: none;
    }
}
@media screen and (max-width: 908px) {
    div.menu1 {
        display: none;
    }
    div.menu-responsive {
        display: block;
    }
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
Thanks, I actually solved that another way but it's good to see that it works.

I have another css related question for EE coming shortly.
RobOwner (Aidellio)Commented:
That's good to hear and thanks for the points.  How did you end up doing it?
Richard KortsBusiness Owner / Chief DeveloperAuthor Commented:
I am now trying to use the @media, it fails and oddly actually does the opposite of what I want.

See this question: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28678469.html

Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.