3

我今天刚开始使用 Zurb 的 Foundation,到目前为止我非常喜欢它。它使建立网站非常快。我已经看到了如何使用我喜欢的列数和嵌套列来创建行。现在我有一个问题。在使用 Foundation 之前,我正在开发一个网站,该网站由一个包装器组成,该包装器包含一个带有导航菜单的标题和一个带有图像滑块的 div,该滑块与标题重叠并部分重叠显示主要内容的网站的下划线部分。我通过使用具有固定像素的相对定位来做到这一点。现在使用 Foundation 我可以重新创建相同的定位吗?到目前为止,我正在与 Foundation 合作的网站是响应式的,所以我想保持响应性。我想我不能使用像素,那么我应该使用百分比来定义 div 的顶部和右侧的属性吗?我不知道该怎么做,因为网格是由列组成的。我附上我想要获得的图像,以使其更清晰。这只是一个简单的模型,但您应该能够理解。

在此处输入图像描述

这是正在使用 Foundation 开发的页面:

在此处输入图像描述 在此处输入图像描述

使用 Foundation 开发的页面的 Html:

<!DOCTYPE html>

<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
  <meta charset="utf-8" />

  <!-- Set the viewport width to device width for mobile -->
  <meta name="viewport" content="width=device-width" />

  <title>Welcome to Foundation | Homepage</title>

  <!-- Included CSS Files (Uncompressed) -->
  <!--
  <link rel="stylesheet" href="stylesheets/foundation.css">
  -->

  <!-- Included CSS Files (Compressed) -->
  <link rel="stylesheet" href="stylesheets/foundation.min.css">
  <link rel="stylesheet" href="stylesheets/app.css">

  <script src="javascripts/modernizr.foundation.js"></script>
</head>
<body>

  <!-- Header and Nav -->

  <div class="row">
    <div class="three columns">
      <h1><img src="images/logo.png" /></h1>
    </div>
    <div class="nine columns">
      <ul class="nav-bar right">
        <li><a href="#">Home</a></li>
        <li><a href="#">Il centro</a></li>
        <li><a href="#">Lo staff</a></li>
        <li><a href="#">Mappa</a></li>
        <li><a href="#">Contatti</a></li>
      </ul>
    </div>
  </div>

  <!-- End Header and Nav -->


  <!-- First Band (Slider) -->
  <!-- The Orbit slider is initialized at the bottom of the page by calling .orbit() on     #slider -->

  <div class="row">
    <div class="three columns">
      <span class="secondary label" style="font-size:26px;">Servizi</span>
      <ul class="nav-bar vertical accordion">
        <li>
          <div class="title">
            <h5>Chinesiterapia</h5>
          </div>
          <ul class="content">
            <li><a href="#">Riabilitazione perineale</a></li>
            <li><a href="#">Fisiokinesiterapia segmentaria</a></li>
            <li><a href="#">Chinesiterapia globale</a></li>
            <li><a href="#">Ginnastica correttiva</a></li>
            <li><a href="#">Recupero post traumatico</a></li>
            <li><a href="#">Ginnastica di gruppo per adulti</a></li>
            <li><a href="#">Rieducazione posturale globale</a></li>
          </ul>
        </li>
        <li>
          <div class="title">
            <h5>Massoterapia</h5>
          </div>
          <ul class="content">
            <li><a href="#">Massaggio manuale</a></li>
            <li><a href="#">Linfodrenaggio</a></li>
            <li><a href="#">Massaggio connettivale</a></li>
          </ul>
        </li>
        <li>
          <div class="title">
            <h5>Terapia fisica</h5>
          </div>
          <ul class="content">
            <li><a href="#">Elettroterapia galvanica</a></li>
            <li><a href="#">Elettroterapia faradica</a></li>
            <li><a href="#">Elettroterapia interferenziale</a></li>
            <li><a href="#">Correnti diadinamiche</a></li>
            <li><a href="#">Elettrostimolazioni</a></li>
            <li><a href="#">Ionoforesi</a></li>
            <li><a href="#">Radarterapia</a></li>
            <li><a href="#">Ultrasuoni</a></li>
            <li><a href="#">Magnetoterapia</a></li>
            <li><a href="#">Laserterapia CO2</a></li>
            <li><a href="#">Test muscolare</a></li>
            <li><a href="#">Tecarterapia</a></li>
            <li><a href="#">Horizontal therapy</a></li>
          </ul>
        </li>
      </ul>
    </div>
    <div class="six columns">
      <div id="slider">
        <img src="images/1.png" />
        <img src="images/2.png" />
        <img src="images/3.png" />
        <img src="images/4.png" />
      </div>

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


  <!-- Three-up Content Blocks -->

  <div class="row">
    <div class="nine columns">
      <img src="http://placehold.it/400x300&text=[img]" />
      <h4>This is a content section.</h4>
      <p>Bacon ipsum dolor sit amet nulla ham qui sint exercitation eiusmod commodo, chuck   duis velit. Aute in reprehenderit, dolore aliqua non est magna in labore pig pork biltong.   Eiusmod swine spare ribs reprehenderit culpa. Boudin aliqua adipisicing rump corned beef.  </p>
    </div>

    <div class="three columns">
      <img src="http://placehold.it/400x300&text=[img]" />
      <h4>This is a content section.</h4>
      <p>Bacon ipsum dolor sit amet nulla ham qui sint exercitation eiusmod commodo, chuck duis velit. Aute in reprehenderit, dolore aliqua non est magna in labore pig pork biltong. Eiusmod swine spare ribs reprehenderit culpa. Boudin aliqua adipisicing rump corned beef.  </p>
    </div>
  </div>


  <!-- Call to Action Panel -->
  <div class="row">
    <div class="twelve columns">

      <div class="panel">
        <h4>Get in touch!</h4>

        <div class="row">
          <div class="nine columns">
            <p>We'd love to hear from you, you attractive person you.</p>
          </div>
          <div class="three columns">
            <a href="#" class="radius button right">Contact Us</a>
          </div>
        </div>
      </div>

    </div>
  </div>


   <!-- Footer -->

   <footer class="row">
     <div class="twelve columns">
      <hr />
      <div class="row">
        <div class="six columns">
          <p>&copy; Copyright no one at all. Go to town.</p>
        </div>
        <div class="six columns">
          <ul class="link-list right">
            <li><a href="#">Link 1</a></li>
            <li><a href="#">Link 2</a></li>
            <li><a href="#">Link 3</a></li>
            <li><a href="#">Link 4</a></li>
          </ul>
        </div>
      </div>
     </div> 
   </footer>

   <!-- Included JS Files (Uncompressed) -->
   <!--
    <script src="javascripts/jquery.js"></script>
    <script src="javascripts/jquery.foundation.mediaQueryToggle.js"></script>
    <script src="javascripts/jquery.foundation.forms.js"></script>
    <script src="javascripts/jquery.foundation.reveal.js"></script>
    <script src="javascripts/jquery.foundation.orbit.js"></script>
    <script src="javascripts/jquery.foundation.navigation.js"></script>
    <script src="javascripts/jquery.foundation.buttons.js"></script>
    <script src="javascripts/jquery.foundation.tabs.js"></script>
    <script src="javascripts/jquery.foundation.tooltips.js"></script>
    <script src="javascripts/jquery.foundation.accordion.js"></script>
    <script src="javascripts/jquery.placeholder.js"></script>
    <script src="javascripts/jquery.foundation.alerts.js"></script>
    <script src="javascripts/jquery.foundation.topbar.js"></script>
    <script src="javascripts/jquery.foundation.joyride.js"></script>
    <script src="javascripts/jquery.foundation.clearing.js"></script>
    <script src="javascripts/jquery.foundation.magellan.js"></script>
    -->

    <!-- Included JS Files (Compressed) -->
    <script src="javascripts/jquery.js"></script>
    <script src="javascripts/foundation.min.js"></script>

    <!-- Initialize JS Plugins -->
    <script src="javascripts/app.js"></script>

    <script type="text/javascript">
   $(window).load(function() {
       $('#slider').orbit();
   });
    </script>

  </body>
</html>

将此 html 文件与最新版本的 Foundation (3.2.2) 一起检查。从这里下载:http: //foundation.zurb.com/download.php

4

2 回答 2

1

You can use css clearfix before your content div:

<div class="clearfix"></div>

or, with the header div:

<div id="header" class="clearfix">

This will give your header a dynamic height and push down your content.

于 2012-12-26T19:43:49.150 回答
0

框架中没有“clearfix”类只有“clearing”

于 2013-09-09T18:59:10.890 回答