简体   繁体   English

图片覆盖另一张图片

[英]image overlay another image

On MY WEBSITE I have this code: 我的网站上,我有以下代码:

<div>
    <center><a href="foo.html"><img src="images/ipadframe.png" width="200" height="300"></a></center>
  </div>  
<div style="position:absolute; left:233; top:35;">
    <img src="images/xclomobi.jpg" width="152" height="233">
</div>
            <div class="section_w280 fl">
                <ul class="future_project"><br><br>
                    <li>Website: <a href="#" target="new">#</a></li>
                    <li>Role:<font size="2"> CSS / PHP / MYSQL</font></li>
                    <li>#li>
                </ul>
                <div class="cleaner"></div>
            </div>


            <div class="section_w140 fr"><br><br>
                <div class="rc_btn_02"><a href="#">Visit</a></div>
                <div class="cleaner"></div>  
                </div>      

            <div class="margin_bottom_20 border_bottom"></div>         
</div>

which displays perfectly on my desktop but not on my ipad or smaller screens. 可以完美显示在我的桌面上,但不能显示在ipad或较小的屏幕上。

how do I edit the div style above so that it loads reads an alternative code when viewing this on a device listed above? 我如何编辑上面的div样式,以便在上面列出的设备上查看该样式时读取一个替代代码?

Is there a way to get it to display correctly no matter what device they are viewing it on? 无论他们在什么设备上观看它,是否都可以使它正确显示?

What you need is implement Responsive design by using @media querys... 您需要的是使用@media查询实现响应式设计 ...

iPAD Portrait and Landscape iPAD纵向和横向

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* STYLES GO HERE */}

iPAD LANDSCAPE iPAD景观

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* STYLES GO HERE */}

iPAD PORTRAIT iPAD人像

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* STYLES GO HERE */ }

By using this, you can set the CSS styles only for that device... Also need to read this ... 通过使用此功能,您可以仅为该设备设置CSS样式...也需要阅读此内容 ...

Another alternative I find myself jumping into are responsive frameworks like Bootstrap or Foundation by ZURB . 我发现自己跳入的另一个选择是响应式框架,例如BootstrapZURB的Foundation They provide a stunning amount of components to get you on your responsive way in record time. 它们提供了数量惊人的组件,可帮助您在创纪录的时间内采取响应式的方式。 Both have their pros and cons, you should eval which one suits your needs. 两者都有其优点和缺点,您应该评估哪个适合您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM