gpt4 book ai didi

css - Zurb Foundation 中的重叠 div

转载 作者:可可西里 更新时间:2023-11-01 14:53:39 26 4
gpt4 key购买 nike

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

enter image description here

这是使用Foundation开发的页面:

enter image description here enter image description here

使用 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

最佳答案

您可以使用 css clearfix在你的内容 div 之前:

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

或者,使用标题 div:

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

这将为您的标题提供动态高度并下推您的内容。

关于css - Zurb Foundation 中的重叠 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14044816/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com