simple responsive design \ best practice

user1025852

Consider two inline-block divs. Now, I want when the user decrease the browser size, that only one <div> will stay visible (and not one <div> to go to the next line...).

How can I implement that?

<style>
    div {
        display:inline-block;
    }
</style>
<div id="first">this should dissapear on narrowing browser</div>
<div id="second">only this should be visible</div>

I use Polymer, so if there is some syntax sugar here would be nice :)

Ali Green

Try this! http://jsbin.com/bibuzu/1/edit

There's a breakpoint at 480px so any widths before then the first div is set to display none and the second div takes up the rest of the space.

@media screen and (max-width: 480px) {
  div.first {
    display: none;
  }

  div.second {
    width: 100%;
  }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Best practice for interface design

From Dev

Is there some "best approach" for responsive design?

From Dev

best practice data design in firebase

From Dev

MVP design pattern best practice

From Dev

MVP in GWT : Best design practice

From Dev

Best way to manage background images with responsive design?

From Dev

Android AsyncTask best practice / design paterns?

From Dev

What is the best practice database design for transactions aggregation?

From Dev

Android AsyncTask best practice / design paterns?

From Dev

Best practice is to use a model or a simple property?

From Dev

Simple type alias - Best practice for Oracle

From Dev

Simple type alias - Best practice for Oracle

From Dev

Best Practice creating simple queue Compact Framework

From Dev

CSS Shape or SVG mask, which is the best approach for responsive design?

From Dev

margin/Padding or Position , which one is best for the responsive design?

From Dev

Responsive Design

From Dev

Responsive Design

From Dev

Responsive design

From Dev

Best practice design on vertx. Eventbus or Singleton for repositories

From Dev

API design - json_api best practice to return no data

From Dev

The best practice to design one to many relationship in EF code first

From Dev

API design - json_api best practice to return no data

From Dev

Best practice for a simple object literal: using "that" or the object's name?

From Dev

Simple trigger element for show/hide overlay (best practice)

From Dev

Responsive Twitter Bootstrap, Best Practice - Create 4 Navigation buttons below logo

From Dev

Debug responsive design

From Dev

Responsive Design for 4 DIVs

From Dev

Android Responsive design

From Dev

Css div responsive design

Related Related

HotTag

Archive