最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Make div disappear when reducing window width? - Stack Overflow

programmeradmin0浏览0评论

How do you make a div disappear when reducing window width, leaving it's plete space available to other elements? I do not mean hiding piece by piece on overflow, but the whole element.

I came across this brilliant feature on the following URL:

Is javascript required or can it be done with CSS? I noticed the page is pretty much HTML5.

How do you make a div disappear when reducing window width, leaving it's plete space available to other elements? I do not mean hiding piece by piece on overflow, but the whole element.

I came across this brilliant feature on the following URL: http://flexslider.woothemes.

Is javascript required or can it be done with CSS? I noticed the page is pretty much HTML5.

Share Improve this question asked Aug 11, 2012 at 1:38 timtim 2,7303 gold badges32 silver badges48 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can do this with just CSS:

@media all and (max-width: 480px) {
  .mydiv { display: none; }
}
发布评论

评论列表(0)

  1. 暂无评论