Solved

[Probably Simple] Responsive CSS Layout Question

Posted on 2016-10-28
4
47 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 51

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 51

Expert Comment

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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 …

747 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

9 Experts available now in Live!

Get 1:1 Help Now