squigworm — 2012-12-04T11:37:13-05:00 — #1
Good Afternoon All,
I am pretty new to we-design and am building a site for my artwork. I am stuck with how to properly build this photo gallery and have it positioned where I need it to be. The gallery must be positioned perfectly because it needs to line up with the background image that acts as the frame for the gallery images. I have designed this based on % in the attempt to eventually make it responsive to four different screen-size ranges. When I test what I have so far it just falls apart when it hits the different browsers. It does fine in dreamweaver's live view but when I test it in any browser either the background image won't show up, or the images stack up on the left side of the page, and it does not respond at all when I shrink the screen. I know I need to learn a LOT and am studying web-design everyday, but in the meantime I need to get this site up while I continue to learn. ANY and ALL help is so so so appreciated I am just stumped. Thank You in advance!
Here is the jsfiddle link to view the code. If this post is not formatted correctly or will somehow deter people from answering PLEASE let me know.
guido2004 — 2012-12-04T12:10:36-05:00 — #2
I corrected some missing " errors in your code, but it's hard to see anything in jsfiddle. It won't find the images of course, so it just shows a bunch of alt-texts.
Can't you put the page somewhere online and post a link?
squigworm — 2012-12-04T15:35:05-05:00 — #3
Hey guido2004, Thank You for responding. I have put this code up on my site www.colinbarclay.com Each picture is represented by a green box and the background - solid blue. Just let me know if there is anything else you need.
guido2004 — 2012-12-04T15:44:51-05:00 — #4
What is wrong with that page?
ralphm — 2012-12-04T18:16:18-05:00 — #5
Hi squigworm. Welcome to the forums.
The first problem is the fixed width on the .page_container div. With that in place, you can't have any responsiveness, so the first step is to remove that width. You can center the background image if it is something fancy ... I assume the blue bg at the moment is for test purposes? (Otherwise, just use a color instead of an image.)
squigworm — 2012-12-05T06:22:00-05:00 — #6
hey guido2004, I was able to work on it after you responded and realized I had something wrong on my end with the main_full css file being linked. I fixed that and realized the background image is coming up just fine. I then realized the images are only collapsing to the right side of the page in Firefox. I am now in the process of trying to make it responsive. thank You again for taking the time to look and respond. if you see anything I should be doing different please let me know. Thank you again, Colin
squigworm — 2012-12-05T06:28:52-05:00 — #7
Hey Ralph.m, Thank You ! and thank you very much for responding. Yes, the blue background page is just for testing purposes. Ok, so I will remove the fixed width all-together, and will center the background page, as it is indeed something fancy :). In regards to centering this image, would position: center; - or - margin: 0% auto 0% auto be an appropriate way to do this in conjunction with the responsiveness? Thanks again for the help !
ralphm — 2012-12-05T08:14:37-05:00 — #8
Place the image as a background image on the containing element. So the CSS would look sommat like this:
background: url(/images/bg-image.jpg) no-repeat 50% 0;
The 50% value will center the image horizontally.
As a rule, bg images are not all that responsive, though there are things you can do about it, such as this:
squigworm — 2012-12-05T08:53:06-05:00 — #9
Thank You again for the help ralph.m, much appreciated. man...the thinking that goes into this stuff can be so brilliant ! I will implement the code you suggested and work with the fix from voormedia.com (which I now have bookmarked) when I get home in a few hours. In regards to the 21 individual gallery images that go inside the gallery div. I have 4 folders in my root directory. One folder is for the gallery images (and their roll-over versions) saved at 100%, the next is for the same images saved at 85%, the next 60% and the next 35%. I have also set up the css media queries (large_css, medium_css, and small_css) to those percentages as well. I have TRIED to set the .html to call a different css file depending on the screen size which will come along with the correctly sized versions of the images. Is this logic correct in terms of getting the different size images to show up when the screen size changes ? or do the images need to be re-sized a different way to work properly ? Thanks again ralph.m.
ralphm — 2012-12-05T20:07:23-05:00 — #10
You can actually just set a %width on images, and the browser will resize them itself, so you can just use the one same image in all situations. (Older PC browsers tended not to render the images so well, but not sure how they handle this now, but I assume it's OK, as this is a common approach.)
The downside is that you are asking people on small screen (mobiles etc.) to download images that are larger than needed. So some clever people out there are working out ways around this. It's still a developing area (the perfect solution hasn't arrived yet, I'm pretty sure). Here are some useful links, though:
All the same, if someone is viewing a gallery on their mobile, they've got to make a decision whether it's worth the downloads or better to wait till they get home. I'm not so worried about the image issue, but it's still worth finding a solution.
squigworm — 2012-12-06T08:27:39-05:00 — #11
Once again...Thank You for taking the time to help me, really appreciate it. I am finding out as I go that responsive design is still very much in the early stages of its inception and there are not yet clear solutions for everything. I was initially going to try and design this gallery for all size devices at once but I found out that is so much more work then I could have ever imagined, so I have had to put the mobile size design aside until I can at least get the larger size orientations functioning clean and fast - it is amazing how much there is to consider, ie.. what you mentioned above in regards to mobile browsing. I am making great progress, and I do have a few more questions but I think I should read these articles and see what I can accomplish first. Thanks again ralph.m. Hopefully the next thing I post on this thread will be the link to a finished product!
squigworm — 2012-12-06T19:00:38-05:00 — #12
Hey ralph.m, I was wondering if you might know why - www.colinbarclay.com - does not work properly in firefox ?. I have tested it in chrome, safari and firefox. When I open it in firefox the padding goes awry and collapses to the left and down. I am going to continue searching but thus far I cannot find a clear answer as to what firefox in particular does not like about the code. I have the code up on jsfiddle - http://jsfiddle.net/squigworm/Xfcdu/ -
ralphm — 2012-12-06T20:50:34-05:00 — #13
I don't see a problem in FF (Mac) but it might be because of your % width on .gallery_container. Given that the page is not flexible at this stage, just set a px width on that container, as you don't always know otherwise how the browser will calculate % into px.
squigworm — 2012-12-07T09:04:02-05:00 — #14
Hey ralph.m I am starting to think it is something local with my firefox. You, and about 5 other people say they see no problem in firefox. ..I spent the better part of two days trying to figure out what was wrong with the code - and looks like nothing was wrong all along .. wowww .. Hey live and learn. Those links you sent are awesome, I am starting to understand a litttttle bit more about the responsive design style. I have some work to do before I ask anything else or try to go any further. Thanks again for all of your help, it is much appreciated.
ralphm — 2012-12-07T09:31:48-05:00 — #15
Could well be. Make sure to refresh the page and/or clear the cache. Browses store older versions of a page often, and you sometimes need to flush it out before you see the latest version.
squigworm — 2012-12-11T15:34:47-05:00 — #16
Hey ralph.m, The site is up at [http://www.colinbarclay.com . I was wondering if you wouldn't mind taking a look and seeing if you could spot any ways to speed up load time. I have the current code up at [URL="http://http://jsfiddle.net/squigworm/6ZLyC/"]http://http://jsfiddle.net/squigworm/6ZLyC/](http://www.colinbarclay.com) So far other people have spotted room/need for improvement in the following places - slow load time, IE has the default link borders showing up (I am about to work on this one <-) and one person who opened it in firefox is seeing the images collapse to the left of the screen. If you have any suggestions I am al ears. Thanks again for all of you help.
ralphm — 2012-12-11T18:51:46-05:00 — #17
The first thing that's really obvious is that the page's background image is way too big (downloads very slowly). It's actually about 2.2 MB in size, which is about 10 to 20 times larger than it should be for a web image. If you have Photoshop or Fireworks, run it through Save for Web, and that will reduce its size massively.
squigworm — 2012-12-11T23:35:35-05:00 — #18
Yea that is pretty big. I wasn't sure how much that would effect it, but clearly...quiet a bit .. Thank You I will alter the image size with Photoshop