Archived

This topic is now archived and is closed to further replies.

  • 0

Responsive Banner Images & Navigation Menu?


Question

Posted · Report post

Hello All,

 

I'm having difficulty with my header/banner within my Pagelines Framework. My two main issues are:

 

1) The 3 images in the Header do not re-size when I re-size the FF/Safari/Chrome browser. The two images to the left and right of the logo were added using a hook within the functions.php file (see attached image)

2) The navigation menu also does not re-size

 

http://nestacupuncture.com/acupuncture/our-treatments/nest-babies/

 

My Settings:

Layout Handling: Responsive w/ Pixel Width

Site Design Mode: Full Width Sections

Header Sections: Branding, Classic Nav, Secondary Nav

 

The following is my css code for the classic nav and the banner images. As you can see, I started with px declarations and tried to switch to em to fix the responsive issue. I basing the em sizes on a base font size of 14px. The below is placed within my child theme in the style.css file.

 

#nav, #navbar {
background-color:#C8BCAC;
-moz-box-shadow: 0 0 3px #C8BCAC;
-webkit-box-shadow: 0 0 3px #C8BCAC;
box-shadow: 0 0 3px #C8BCAC;
font-family:Arial, Helvetica, sans-serif;
}
#navbar .navbar-inner{
background-color:#C8BCAC;
}
.navigation_wrap, .main_nav_container{
	background-color: #C8BCAC;
	/* height: 55px; */
		height: 3.929em;
}

ul#menu-nav {
margin: 0 0 0 10px;	
}

#page .sf-menu li a, #page ul.sf-menu a:focus, #page .sf-menu a:hover, #page .sf-menu a:active, #page .main-nav a {
	background: none repeat scroll 0 0 #C8BCAC;
	font-family: Arial, Helvetica, sans-serif;
	letter-spacing: 1px;
	text-transform: uppercase;
/*	padding-top: 20px; */
	padding-top: 1.429em;
/*	font-size: 95%; */
	font-size: 1.0em;
	font-weight:500;
	margin: 0 1.286em 0 1.286em;
	/* margin: 0 18px 0 18px; */
}

#page .sf-menu li a, #page ul.sf-menu a:focus, #page .sf-menu a:hover, #page .sf-menu a:active, #page .main-nav a {
    color: #FFFFFF;
	font-family:Arial, Helvetica, sans-serif;
}
li {
  /*  line-height: 21px; */
	line-height: 1.500em;
}

.site_tagline {
/*	width: 260px; */
	float: left;
}

.section-branding .mainlogo-img {
    display: block;
/*    max-width: 142px; */
/*	margin: 20px 70px 30px 180px; */
		margin: 1.429em 5.000em 2.143em 12.857em;
	float:left;
}
.social_links {
float:left;	
z-index:99;
/* margin: 0 0 0 40px; */
margin: 0 0 0 2.857em;
}

 

I have the "Disable Mobile View" UNCHECKED. I tried checking it, and while it looked somewhat better on the iPhone, it did not fix the fact that the banner images & nav were not resizing.

 

Can someone point me in the right direction?

 

Any help is greatly appreciated! Thank you.

 

 

post-23728-0-81434600-1356638416_thumb.p

post-23728-0-05837900-1356638432_thumb.p

post-23728-0-06011000-1356638439_thumb.p

Share this post


Link to post
Share on other sites

1 answer to this question

Posted · Report post

Hi there,

 

If you've added the images using a hook and they have a static px width then they won't re-size responsively. The responsive layout will try and stack them on top of one another as the browser re-sizes so they best fit the screen.  The best way to avoid this would be to disable the mobile view so the items don't stack. In order to get the images to then re-size for the smaller screen you'll need to use some browser specific css on the images. You can download the browser specific css plugin for free from the pagelines store and use the @media prefix for mobile devices. The result will be something like the example below

 

@media(max-width: 480px) {
.site_tagline {
    float: left;
    max-width:50px;
}
}

 

The navbar is acting responsively for the layout, as the width reduces the items stack under one another to fill the available space, the background color for the nav isn't resizing with the li elements, so you can combat that using the below css and placing your chosen color value in.

 

.navigation_wrap, .main_nav_container {
    background-color: #C8BCAC;
    height: 100% !important;
}

Hope this helps

Share this post


Link to post
Share on other sites