Solved

make a header responsive

Posted on 2015-02-10
5
96 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
  • 2
  • 2
5 Comments
 
LVL 8

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 8

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
REST endpoint query with a parameter 1 18
GET error with Font Awesome 3 19
message Alert on an empty search 10 23
I'm a Human captcha checkbox 13 23
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

820 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