Solved

[Probably Simple] Responsive CSS Layout Question

Posted on 2016-10-28
4
76 Views
Last Modified: 2016-11-01
https://www.custompatches.net/

All I want is for the quote form to no be shoved all the way to the bottom on smaller screen sizes. I want it to be right below the slider. But I want it to stay as is on desktop. Is this simple enough to do?
0
Comment
Question by:underrugswept
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41864818
For small screen sizes, you could try using a media query to apply style:
display: table;

Open in new window

to the parent container, and style:
display: table-header-group;

Open in new window

to the slider to make it appear at the top, and style:
display: table-footer-group;

Open in new window

to the containers that you want below the form, to make them appear last.

That would leave the form appearing in the middle section of the table, after the slider.

Someone has put together a jsfiddle demonstrating this already: http://jsfiddle.net/lockedown/gyef3vj7/1/
0
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41868609
This is achievable but you need to restructure your markup. You currently have the sidebar outside of the container that holds the slider and other main page content.

Start with a mobile first design
<div>Slider</div>
<div>Form</div>
<div>Other content</div>

Then add BS classes to move the navbar out to the left on larger screens. Something like this
  <div class="row">
    <div class="col-sm-12 col-xs-12 col-md-9 pull-right">
      <div class="slider"></div>
    </div>
    <div class="col-sm-12 col-xs-12 col-md-3">
      <form>
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
        <input type="text" class="form-control">
      </form>
    </div>
    <div class="col-sm-12 col-xs-12 col-md-9 pull-right">
      <div class="supplementary"></div>
    </div>
  </div>

Open in new window

Working sample here - the blue and green areas are placeholders for the slider and other content on the page.
1
 
LVL 1

Author Closing Comment

by:underrugswept
ID: 41868876
Yes, that worked, as always. Thank you so much!
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 41868944
You are welcome.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now