Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bootstrap - stretch hero images

Posted on 2014-02-27
8
Medium Priority
?
486 Views
Last Modified: 2014-03-05
How do I stretch the hero image (big pic to right of nav) so it fits the largest desktop size?  We got the animation to work good but that is only be on the home page.  

I played around with this on the below page:

http://nsitedesigns.com/nsitedesigns/wiplastic_scott/about2.html
http://nsitedesigns.com/nsitedesigns/wiplastic_scott/wiplastic2.css
0
Comment
Question by:nsitedesigns
[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
  • 4
  • 2
  • 2
8 Comments
 

Author Comment

by:nsitedesigns
ID: 39893205
does anyone have any ideas?
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 39893434
You need to change your actual image width from 752px to 100% (height auto or 100%) then it will stretch to fit its container.. By giving it an actual px size it will never respond to its containing environment.
You may need to play around with the css for the hero as the image height will then be greater that your left hand menu and look a bit odd.

Cheers,
N
0
 

Author Comment

by:nsitedesigns
ID: 39893447
Would I change BOTH width and height to 100%?
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 39893453
You could although height auto will work as long as the width is set to 100%.
N
0
 

Author Comment

by:nsitedesigns
ID: 39893490
The nav works good for the slider animation.  If I change the css for the nav, then that won't look right.  It's like a catch-22.  fix one thing and the other goes bad.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39893775
I could have sworn I had this all working already...  
The side nav is not really normal set up.  To do what you want, we need to hide one version of the hero for larger screens and then switch out.  http://jsbin.com/koniximi/1/

Now it is a matter of getting the white background back when xs.

   <div id="xanimation_container" class="hidden-xs col-xs-12 col-sm-9 ihero">
        <img src="http://nsitedesigns.com/nsitedesigns/wiplastic_scott/img/pl4_2.jpg" class="img-responsive" /> 
      </div>
        <div class="visible-xs ihero">
        <img src="http://nsitedesigns.com/nsitedesigns/wiplastic_scott/img/pl4_2.jpg" class="img-responsive" /> 
      </div>
      
      <!-- end hero -->

Open in new window

0
 

Author Comment

by:nsitedesigns
ID: 39894831
Hi Scott,

I was working on getting the slider to work and that messed up the other code you provided.
0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39894863
What is happening is the .col- is adding left and right padding.  The solution I provided is an easy work around.  You could also use a media query and set the class ihero to padding:0px!important when below the xs threshold.  The way I have provide work within bootstrap.  Either way is good.
0

Featured Post

Industry Leaders: 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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

636 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