Solved

make a header responsive

Posted on 2015-02-10
5
102 Views
Last Modified: 2015-02-10
Hi, the boss is going to want something like the header here on our new responsive site.
magickitchen.com

The question is, how do I make a header that looks good on all screen sizes? I've uploaded the header here as well.header
0
Comment
Question by:mel200
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
James Bilous earned 250 total points
ID: 40600869
If the header is a static image it'll be a bit tricky. If so - you could make the image the background of a DIV and set its size to 100%.

#header_area {
    background: url('my_header_image.com');
    background-repeat:no-repeat;
    background-position: top center;
    background-size: 100%;
    max-width: 100%;
    height: auto;
}

Open in new window

1
 

Author Comment

by:mel200
ID: 40601144
Ok, thanks... what width would you recommend I make it?
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 250 total points
ID: 40601204
If you use media queries you can just set the image width based on the width of the device. If you set width and not height the height will be calculated to maintain the aspect ration.  However for some small mobile devices you might want to consider not using an image that big with text included because it may not look good an very small screens.  You could go with an alternate that mainly features just the logo and some text.

Cd&
0
 
LVL 9

Expert Comment

by:James Bilous
ID: 40601229
Thats really your call and depends on the size of the browser you want to support. Making it large will keep it from pixelating when it gets too big but will take longer to load so you may want to play with it a bit.

If you want to keep from having the banner get too big you can surround the div with the header background image in another div with a max-width. For example:

#mydiv {
   max-width: 1024px
}

<div id="mydiv">
   <div id="header_area"> </div>
</div>

Open in new window

0
 

Author Closing Comment

by:mel200
ID: 40601318
Thanks, all!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question