Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: Responsive website layout question

  1. #1
    Join Date
    Mar 2004
    Oklahoma, USA

    Responsive website layout question

    I am designing my first responsive website and having a number of problems. I am trying to place 4 images on a page and have the names of the images centered below the images.

    Here is a quick layout I made to help explain my question:

    I am using a 12 column grid from "Responsive Grid System".
    I am using this code to place my first image:
    <div id="painting1" class="col span_1_of_2">
    <div class="one">
    <img src="images/spring380.jpg" alt="painting 1">
    I used padding to place the image up against the right side of the first column.

    The layout of the images seems to work OK.

    My problem comes in placing the names beneath the images.

    I made a new "col span_1_of_2" beneath the images for the names.

    Seeing the column extends to the left of the first image and to the right of the second image, I can't figure out how to center the names below the images. I added the names in a DIV, and used padding to center the names, but as the page width is reduced, the names do not remain centers under the images.

    I have spent the better part of a day working on this problem and nothing seems to work for all the different screen resolutions.

    Does anyone have a fix for this problem?

    Last edited by lkeeney; 05-05-2014 at 02:43 PM.

  2. #2
    Join Date
    Mar 2011
    I'm not familiar with whatever "Responsive Grid System" is, but given the code you posted I would expect that adding 'text-align:center' to the CSS rules for the class .one will center both the image and any text you insert after it the way you want.

    But do yourself a favor and stop trying to learn CSS by trial-and-error. Go find a CSS tutorial online or a book on web design at your local library and build your understanding of how things work from the ground up. Trying to jump all the way from simple HTML to responsive design in one step will just leave you frustrated. Good luck!
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Mar 2004
    Oklahoma, USA
    I have signed up with linda.com and have been watching every course they have on responsive website design. I have also been watching all the videos I can find on youtube.com, but have not found anything that covers the problem I have.

    All the videos I have watched cover very specific unique designs but I haven't found anything which talks about problems like this.

    Unfortunately, 'text-align:center' does not work because the image is offset within this div, so the text would not center under the image.
    Last edited by lkeeney; 05-05-2014 at 10:20 PM.

  4. #4
    Join Date
    Mar 2011
    You really didn't post enough information to be specific. I'd need to see the relevant CSS for that. You might post a link to the page so I can see everything.

    But my point remains. This isn't a "responsive design" issue, and trying to learn about responsive design before you understand the basics of CSS is not the way to go. You'll just keep running into issues like this.
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Aug 2007
    I think you much use frameworks to do responsive sites and Bootstrap is the best to do that. Also please read some articles for responsive HTML.

    Please post here more description with Example uploaded somewhere so some can help you ..

  6. #6
    Join Date
    Mar 2004
    Oklahoma, USA
    Quote Originally Posted by rtrethewey View Post
    You really didn't post enough information to be specific. I'd need to see the relevant CSS for that. You might post a link to the page so I can see everything.

    But my point remains. This isn't a "responsive design" issue, and trying to learn about responsive design before you understand the basics of CSS is not the way to go. You'll just keep running into issues like this.
    Unfortunately, I can't post the link to the website. This is an unusual job where I had to sign a non-disclosure agreement with the client. This is why I put together the layout image of the page.

  7. #7
    Join Date
    Mar 2004
    Oklahoma, USA
    As I reported to Rick, I can not post the "Example" page. I understand it is very difficult to give comments on something where you can not see the problem. This client if very concerned about me not releasing any information about their new business. This makes it difficult for me to even try to explain the problem.

    I am using a custom grid system by http://www.responsivegridsystem.com/

  8. #8
    Join Date
    Feb 2013
    Two possible solutions is either using clear fix : http://davidwalsh.name/css-clear-fix


      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
    This is the best I can do without actually seeing the html/css. Though if I were to take a guess, I think box-sizing is the answer/solution.

  9. #9
    Join Date
    Mar 2004
    Oklahoma, USA

    I haven't looked into your reply yet, but I will.

    I thought I could present the problem more clearly with this image:

    This image is showing the left half of the screen with 6 columns of a 12 column grid.

    The blue lines represent the grid on which the items are placed. The yellow are two divs to hold content. The red is the photo placed in the grid using margins.

    What I want to do is to center the "Name of the Photo" under the photo. Unfortunately on everything I have tried, it get broken when the page size changes.

    About Me:

    I am a 78 year old retired Electronic Engineering Manager. When I retired 13 years ago, I took up photography and have a studio where I have been photographing models, actors, singers and dancers since I started the business.

    If anyone is interested, here is my company website: http://www.lawrencecreativephotography.com

    I have been hand-coding websites since the mid 1980's. I have built some quite complex websites including a flash website loaded with animation for a company. I have built many sites for industrial companies, in fact I was flown across the country to photograph the products and facilities for a large explosive manufacturing company. I used the photo in a website I designed for them.

    I job I am working on now started out as a simple website with just a couple of pages. Unfortunately, after I had the site almost completed the client wanted it changed to a responsive website, and wanted to make sure it would work on everything from the oldest iPhone to the largest desktop monitor.

    This was about 2 weeks ago. I have been studying everything I can find on "Responsive Website Design", but having a hard time wrapping my head around this.

  10. #10
    Join Date
    Mar 2012
    Larry, I suspect that you are trying to solve the wrong problem. It seems to me that the problem is that you are using padding to place the images. That is why the text won't center. And I suspect that it isn't going to. Without seeing the actual code, I'd suggest you try:

    1. Remove the padding (or make it symmetrical).
    2. Center the text under each image (this should now be simple).
    3. If necessary place each image/text pair in a parent div to allow you to place both on the page as a single item.

  11. #11
    Join Date
    Mar 2004
    Oklahoma, USA
    The client for this website is very particular about placement of items on the page. The original non-responsive website I designed for them was designed in accordance with a layout they had made on paper. They want the same layout only now they want it responsive.

    To show you how specific this particular client is, they had me design the navigation for this site where the text of each navigation button was shown inside of a picture frame with matting. The text wasn't single words, but sentences which took up two lines. They then wanted the background of the navigation bar to be a very specific shade of "celery" color, and the wanted the background to have a specific texture as well.

    I have all this designed in the non-responsive website and I am dreading trying to get this same navigation into a responsive website.

    Another thing, when this site is viewed on a cell phone, they don't want the two photos which are now side-by-side to drop down one under the other as will happen with a normal responsive set up. They still want the photos to appear side-by-side even on a cell phone.

    I think they are asking things that are pushing the limits of a responsive design capabilities.

    As I mentioned I am certainly no expert at any type of website design, but it looks to me like there are many limits to what you can do in layout with a responsive design.

  12. #12
    Join Date
    Mar 2012
    Thanks for the explanation. It is possible to make the two images stay horizontally aligned, again you use a parent div that only allows that orientation.

    Overall, I'd suggest that the way ahead is to design three or four essentially static displays, with media-specific style sheets (or media queries) using "device-width" instead of "width". Your existing static design can be one of these displays. Note: I will assume that your static display was designed for 1024px (or thereabouts). If not, amend the strategy below to correspond.

    (more to follow...)

  13. #13
    Join Date
    Mar 2012
    Use code something like:
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="style.css" title="styles" type="text/css">
    <link rel="stylesheet" href="medium.css" media="screen and (min-device-width:480px) and (max-device-width:1023px)" title="styles" type="text/css">
    <link rel="stylesheet" href="handheld.css" media="screen and (max-device-width:479px)" title="styles" type="text/css">
    <link rel="stylesheet" href="handheld.css" media="handheld" title="styles" type="text/css">
    This example uses three style sheets to configure the display for different device widths:

    style.css - The default style sheet. This can be your existing static style sheet. Note: This assumes that the static design was designed for 1024px width. If that is not the case, amend the code accordingly...

    medium.css - A style sheet for interim sized displays. Design it for 480px width.

    handheld.css - A style sheet for the smallest screens. Design it for 240px width.

    So rather than a design which adjusts dynamically for an size display, you have three static displays, one of which you have already designed. One problem you have with using "display-width" instead of "width" is that you need to test it on devices with the actual screen width. Therefore, for test purposes, you may want to substitute "width". Then you can use a set of IFrames 240px, 480px and 1024px wide to show how the site will appear o the range of devices.

  14. #14
    "Grids" and "responsive" don't even belong in the same sentence, but then Grids were a dumb idea BEFORE we had responsive layouts since they by definiton are not fluid or elastic; a well written modern website should be elastic, semi-fluid AND responsive, and grids are NOT going to deliver that.

    No matter how many half-assed code-bloat framework scams try to tell you otherwise. (and people wonder why I consider "frameworks" to have a negative connotations).

    That said, you're getting WAY too fancy over something simple.

    <div class="plate">
      <img src="images/whatever.jpg" alt="describe this" /><br />
      Put your text here
    <!-- .plate --></div>
    .plate {
      width:160px; /* or whatever your image size is */
    DONE. That's it. That's all.

    Well, except whatever that "responsive grid" nonsense is likely has you throwing around classes in a presentationa manner and extra DIV wrappers all over the place for nothing.

  15. #15
    Join Date
    Jan 2014

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.17864 seconds
  • Memory Usage 3,032KB
  • Queries Executed 16 (?)
More Information
Template Usage (37):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (75):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • fetch_postattach_query
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates