Q:

Css Media queries using with current div style

Can I use Media queries with current div style maybe like that:
.myDiv {
  anyStyle : ...;

  @media (myDiv's width > 100px) {
    height: 40px;
  }

}

I found several pages,but there said only using window params.
if anybody know how to use the media, please tell me about 
I saw the links:

http://www.w3schools.com/css/css_mediatypes.asp
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
http://mobile.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

A:

No.
You can't use media queries to check the width of an item on your website. Media queries only check the viewport variables like width and height. You should use them to check what kind of screen your user has and not what style you have applied to your div.

A:

You should do it that way:
.myDiv {
    /* your styles */
}

@media only screen (min-width: 100px) {
    .myDiv {
        /* other styles */
    }
}

The only way to work with media queries is to rely on device type (screen, print etc.) and/or device width (min-width, max-width).

