lprsd
lprsd

Reputation: 87205

Approach for CSS responsive layout

Disclaimer: I am not a designer. I don't know enough about responsive CSS approaches. Go easy on me! I am a developer that is trying his hands to create an adoptive layout.

I'm using twitter bootstrap 3. Here is the layout I need in the Portrait mode:

Portrait mode image

And here is what it should change to in the Landscape mode:

enter image description here

And here is the "layout algorithm" I have in my mind:

Now my questions:

Upvotes: 0

Views: 211

Answers (2)

Carol Skelly
Carol Skelly

Reputation: 362770

Demo http://www.bootply.com/104401

Create a CSS media query for the breakpoint between portrait and landscape (for example this is 480px on iPhone). This can be used to pull the pie chart to the right:

@media (min-width: 480px) {
    .push{float:right;}
}

Then another query to tell Bootstrap to stack the columns on portrait:

@media (max-width: 480px) {
    .breakpoint{width:100%;}
}

Use push and breakpoint classes accordingly as shown in the Bootply.

Upvotes: 1

LorDex
LorDex

Reputation: 2636

yes, you can use CSS3 media queries. check for device-width and device-height respectively.

Upvotes: 1

Related Questions