css - Responsive layout side by side on desktop, overlay with nav on mobile -



css - Responsive layout side by side on desktop, overlay with nav on mobile -

i'm looking responsive pattern have 2 pages side side (or phone call div's)

|--------|--------| | | | | p1 | p2 | | | | | | | |--------|--------|

as shrink width of page, or view on mobile, collapses single page. lets -> in upper right corner illustrates link access page two.

|--------| | ->| | | | p1 | | | |--------|

and similar on page two, <-- go page one

|--------| |<- | | | | p2 | | | |--------|

any thought how can accomplish this. there libraries out there supporting this, bootstrap or foundation or "do yourself". :)

thanks, lars

you accomplish using css @media queries this:

jsfiddle - demo

class="snippet-code-css lang-css prettyprint-override">.div { width:50%; height:100px; float:left; } .div-1 { background:red; } .div-2 { background:blue; } @media (max-width:480px) { .div { float:none; width:100%; } } class="snippet-code-html lang-html prettyprint-override"><div class="div div-1"></div> <div class="div div-2"></div>

[edited]

jsfiddle - demo

class="snippet-code-css lang-css prettyprint-override">body { margin:0; overflow: hidden; } { color:white; width: 100%; height: 100%; display: inline-block; font-size: 36px; line-height: 100px; text-align: center; } .div { width:50%; height:100px; float:left; } .div-1 { background:red; } .div-2 { background:blue; } @media (max-width:680px) { .div-p { width:200%; } } class="snippet-code-html lang-html prettyprint-override"><div class="div-p"> <div id="div-1" class="div div-1"> <a href="#div-2">page 1</a> </div> <div id="div-2" class="div div-2"> <a href="#div-1">page 2</a> </div> </div>

css responsive-design

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -