Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
快速提问:我有一个 1000 像素宽的 flash 横幅。我希望当用户的屏幕(如智能手机)小于 1000 像素时,替换图像。我怎样才能做到这一点?谢谢!
隐藏 flash 横幅并在宽度小于 1000px 时使用 css 中的以下代码显示图像:
@media screen and (min-width:1000px) { #flash_banner {display:block;} #image {display:none;} } @media screen and (max-width:999px) { #flash_banner {display:none;} #image {display:block;} }
希望它对你有用。