nsitedesigns
asked on
Bootstrap - multiple images file name problem
I was advised to create multiple image size of same image so that bootstrap can call the correct image that "fits" the proper screen size.
For example, p_1.png is sized to 752x283. I was told that I need to create two different sizes of this exact same image.
I am confused as to how to tell bootstrap which file image to use when the screen is at a certain size. I cannot save the image (with 3 different sizes) as the same file name.
http://nsitedesigns.com/nsitedesigns/wiplastic_scott/index.html
http://nsitedesigns.com/nsitedesigns/wiplastic_scott/wiplastic2.css
For example, p_1.png is sized to 752x283. I was told that I need to create two different sizes of this exact same image.
I am confused as to how to tell bootstrap which file image to use when the screen is at a certain size. I cannot save the image (with 3 different sizes) as the same file name.
http://nsitedesigns.com/nsitedesigns/wiplastic_scott/index.html
http://nsitedesigns.com/nsitedesigns/wiplastic_scott/wiplastic2.css
Maybe this tutorial will help.
I wouldn't bother for the few kb you might save in that image.
Otherwise one way is to forget the image tag and use media queries to set the background of the container element according to the screen size.
Otherwise one way is to forget the image tag and use media queries to set the background of the container element according to the screen size.
ASKER
Randy, your suggestion didn't really answer my question.
Cathal, are you suggesting that I just create one very large image and then have the system resize it? Below is link to live site that I am redoing so it is responsive. Each button has a unqiue hero image plus on the home page, there is animation. Are you suggesting I create a div in the position of where the image now resides and simply put the image as a background?
Live Site
http://www.wiplastic.com/capabilities.html
Cathal, are you suggesting that I just create one very large image and then have the system resize it? Below is link to live site that I am redoing so it is responsive. Each button has a unqiue hero image plus on the home page, there is animation. Are you suggesting I create a div in the position of where the image now resides and simply put the image as a background?
Live Site
http://www.wiplastic.com/capabilities.html
Actually I thought you meant the '3' images.
That page is 800kb in size, cropping a few kb off the images (which you could do just by optimizing them for the web) is not going to make much difference in the larger scale.
If you had images that were running into the 100's of kb then yes it would make sense to have smaller versions but only because you would be saving 100's of kb's.
Best thing you could do is remove the flash, won't even show on iphones etc
As I said earlier the easy way to do this is use a background image that you can set with your media queries depending the screen size
That page is 800kb in size, cropping a few kb off the images (which you could do just by optimizing them for the web) is not going to make much difference in the larger scale.
If you had images that were running into the 100's of kb then yes it would make sense to have smaller versions but only because you would be saving 100's of kb's.
Best thing you could do is remove the flash, won't even show on iphones etc
As I said earlier the easy way to do this is use a background image that you can set with your media queries depending the screen size
ASKER
Actually, the animation is not flash. It does work on my android phone. But perhaps, it will not work on iphone. Not sure.
Right now, i am not so much worried about the animation as I am worried about getting the hero image (big honking pic to right of navigation) on each page to fit into the opening nicely. Currently, there is a big gap on the right side that would like to get rid of. Would making the pic that much wider and put it as a background work?
Right now, i am not so much worried about the animation as I am worried about getting the hero image (big honking pic to right of navigation) on each page to fit into the opening nicely. Currently, there is a big gap on the right side that would like to get rid of. Would making the pic that much wider and put it as a background work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That does help ALOT on the bigger screens. On the smaller screens I have a black background that now extends below the images. Where is that coming from? I thought maybe the #animation_container but that doesn't have any background color.
ASKER
I think I found it!
ASKER
Hmmm, now there is a huge gap below the animation on mobile device. Is that from modfiying the carousel? Is the height messing things up for smaller devices?
.carousel-inner .item {
height: 280px;
overflow: hidden
}
.carousel-inner .item {
height: 280px;
overflow: hidden
}
I think I would be inclined to go with a background image on the div and remove the image and use cover, problem with this is it will not work on IE8 or lower. But you could add some css to counter for it.
Else you are going to be constantly fighting against yourself to get it to look right at any size.
Else you are going to be constantly fighting against yourself to get it to look right at any size.
ASKER
So, maybe the original suggestion to create 3 separate images for the 3 different sizes would be the best option?
We are talking about the slider...???
ASKER
well, yes and no. the slider will only appear on the home page. on other interior pages, there will be a hero image.
Check out live site to see what we are trying to reproduce.
http://www.wiplastic.com/
Check out live site to see what we are trying to reproduce.
http://www.wiplastic.com/
I would go with the background image using background-size cover, add an IE shim to your site and that is IE8 and lower covered (so to speak)
ASKER
Thanks for the link. I searched for ie shim and got this page.
https://github.com/Modernizr/Modernizr/search?q=ie+shim&ref=cmdform
This looks a bit beyond what I am familiar with. YIKES!
Maybe you can help me again?
p.s. I see you are from the Emerald Isle. Too bad, if you lived in the states, I would buy you a beer for all the help you gave me today.
p.s.s. Shouldn't you be out having fun on a friday night nearly 11 pm?
https://github.com/Modernizr/Modernizr/search?q=ie+shim&ref=cmdform
This looks a bit beyond what I am familiar with. YIKES!
Maybe you can help me again?
p.s. I see you are from the Emerald Isle. Too bad, if you lived in the states, I would buy you a beer for all the help you gave me today.
p.s.s. Shouldn't you be out having fun on a friday night nearly 11 pm?
You don't need to do anything with it but include it in your page like any other javascript
And you are done.
p.s.
Very soon! My mouth is already salivating.
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
And you are done.
p.s.
Very soon! My mouth is already salivating.
ASKER
have fun - i am calling it a day.
thanks again!
thanks again!
ASKER
Still not "getting this" but I will give you points for your effort and repost question. Maybe someone else has an idea.