自动高度不起作用

时间:2013-12-17 18:48:13

标签: html css

我正在使用视差滚动的网站上工作。网站上的每个子页面(部分)都是相同的高度,但我想将最后一个设置为自动高度。最后一节有很多内容,所以我想让它自动高度,但我不起作用。

#kontakt内的Divs正在浮动。

HTML:

            <section id="kontakt" data-speed="10" data-type="background">
              <article>
                  <div class="pasek_suwakow" style="top: 290px;">
                    <a href="#marki"><div class="suwak_gora"></div></a>
                    <a href="#manifest"><div class="suwak"></div></a>
                    <a href="#wspolpraca"><div class="suwak"></div></a>
                    <a href="#realizacje"><div class="suwak"></div></a>
                    <a href="#kontakt"><div class="suwak_dol_wybrane"></div></a>
                  </div>



               <div id="lastsection">

                <div id="map">
                    <div id="vmap"></div>

                </div>

                <div id="contactbox">
                    <div id="contactleft">


                        <div id="contacttext">
                        Siedziba firmy:<br><br>NEBIOLO POLSKA sp. z o. o.<br><br>ul. Olszewskiego 20<br>25-663 Kielce<br>Polska<br><br>tel. +48 41 278 72 60<br>fax. +48 41 278 72 61<br>email. office@nebiolo.com.pl<br>www.nebiolo.com.pl
                        </div>


                    </div>
                    <div id="contactright">

                    <form action="index.php" method="post" enctype="multipart/form-data" id="formularz">
                        <label  for="name">Imię i nazwisko:</label><input type="text" name="name" id="formularz_name"/></br></br>
                        <label  for="email">Email:</label><input type="text" name="email" id="formularz_email"/></br></br>
                        <label  for="phone">Telefon kontaktowy:</label><input type="text" name="phone" id="formularz_phone"/></br></br>
                        <label  for="enquiry">Treść zapytania:</label><textarea name="enquiry" cols="40" rows="5" id="formularz_text"></textarea></br></br>
                        <input type="button" id="contact_button" class="przycisk" value="Wyślij" />
                        </form>

                    <div id="formularz_odpowiedz">

                    </div>      
                </div>
                </div>
                   </div>

                <div id="distributors">Wybierz kraj aby pokazać dystrybutorów</div>

                <table class="listadeweloperow Sweden">
                <tr class="nazwakraju"><td>Szwecja</td></tr>
                <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                    <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                        <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                        <tr class="wpisdystry">
                    <td><img src="images/mztlogomini.png" alt="MZT"></td><td>ECO SOLUTIONS SCANDINAVIA</td><td>STALLARHOLMSVAGEN 49, 124 59 BANDHAGEN,</td><td>STOCKHOLM, SWEDEN</td><td>00 48 784 77 44 25,</td><td>SE: + 46 760 572 551</td><td><a href="http://ecocolutions.se/" style="color:#0072c2;">http://ecocolutions.se/</a></td><td>support@ecosolutions.se</td>
                </tr>
                </table>    



             <br style="clear:both;font-size:0;line-height:0;height:0;" />
              </article>
            </section>

CSS:

#kontakt { 
background: #e9e9e7; 
height: 1000px;
margin: 0 auto; 
width: 100%; 
max-width: 1920px; 
position: relative; 
box-shadow: 0 0 50px rgba(0,0,0,0.8);
overflow:hidden;
}


#kontakt article{

position: relative; 
width: 100%; 
top: 0px;
font-size: 21px;
color: #777777;
font-family: sspro-light;
}

如何将最后一节#kontakt设置为自动高度?适合内容。

1 个答案:

答案 0 :(得分:0)

在#lastsection结束之前添加它以清除所有浮动的div

<div style ="clear:both"></div>