简体   繁体   English

Div大小无法正确加载HTML

[英]Div size won't properly load HTML

I working on a phone app for a local Telecommunications business using HTML, CSS, Javascript and compiling it with Phone Gap. 我使用HTML,CSS,Javascript编写本地电话业务的电话应用程序,并使用Phone Gap进行编译。 Currently, I've run into a problem with the sizing of the Divs using the IDangerous Swiper CSS. 目前,我在使用IDangerous Swiper CSS调整Div大小时遇到​​了问题。 As I load the page, the Div shows a size of 0px x 0px, but is set for 100% width and height. 当我加载页面时,Div显示大小为0px x 0px,但宽度和高度设置为100%。 It will only load after reloading the page. 仅在重新加载页面后才加载。

<div data-role="content">
<div class="swiper-container-third center";>
    <div class="swiper-wrapper center";>
        <!--First Slide-->
        <div class="swiper-slide center"> 
        <img class="dealsCenter" src="http://web.duo-county.com/images/app_promos/sidebar-brandpromo.jpg"/>
    </div>
    <!--Second Slide-->
    <div class="swiper-slide center">
        <img class="dealsCenter" src="http://web.duo-county.com/images/app_promos/sidebar-monthly-broadband.jpg"/>
    </div>
    <!--Third Slide-->
    <div class="swiper-slide center">
        <img class="dealsCenter" src="http://web.duo-county.com/images/app_promos/sidebar-monthly-video.jpg"/>
    </div>
</div>
</div>

The class "center" is just CSS that says text-align: center !important; 类“ center”只是表示text-align: center !important; CSS text-align: center !important;

I just need help with figuring what it could be that would cause the Div "swiper-container-third" to equal 1319px x 0px and the "swiper-wrapper" to equal 0px x 0px. 我只是需要帮助弄清楚那将导致Div的“ swiper-container-third”等于1319px x 0px,而“ swiper-wrapper”等于0px x 0px可能是什么。 Any help would be highly appreciated! 任何帮助将不胜感激!

I have used this plugin in my currently project intensively. 我在当前项目中集中使用了此插件。 Here are few reasons: 原因如下:

  1. .swiper-container-third and .swiper-slide does not have height specified in CSS. .swiper-container-third和.swiper-slide没有在CSS中指定的高度。 You must have to. 你必须要。 Both has to have width and height equal. 两者的宽度和高度必须相等。
  2. Did you miss CSS given by IDangerous? 您是否错过了IDangerous提供的CSS?

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

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