gpt4 book ai didi

html - Susy 专栏正在崩溃

转载 作者:行者123 更新时间:2023-11-28 09:46:58 25 4
gpt4 key购买 nike

我在使用 Susy 响应式网格时遇到了一些问题。我正在尝试设置两行三列布局。这是我正在使用的代码。

$susy: (
columns: 12,
gutters: 1/2,
math: fluid,
output: float,
gutter-position: inside,
);

$desktop:960px;

@include breakpoint($desktop){
body{
@include container(95%);
background: $faintgray;
}

.container {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}

h2 {
margin: 0 auto 13px auto
}

section {
@include span(4);
text-align: center;
}

section:not(:first-of-type) {
border-left: 1px dashed $lightgray;
}

}

这是 HTML:

<div class="container">
<section id="frost">
<h2>Frost Bank</h2>
<p>Frost Bank founded in 1868 is based in San Antonio with over 110 financial centers across the state.</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>

<section id="shiner">
<h2>Shiner</h2>
<p>Spoetzl Brewery was founded in 1909 in Shiner, Texas. It's the oldest brewery in our Lone Star State.</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>

<section id="whataburger">
<h2>Whataburger</h2>
<p>Their first burger stand opened in 1950. They serve fresh food made daily, just like you like it.</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>

<section id="costadelmar">
<h2>Costa Del Mar</h2>
<p>Daytona Beach based Costa, specializes in polarized sunglasses for fishing, sailing, and surfing.</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>

<section id="honeysucklewhite">
<h2>Costa Del Mar</h2>
<p>Daytona Beach based Costa, specializes in polarized sunglasses for fishing, sailing, and surfing.</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>

<section id="morestuff">
<h2>More Stuff</h2>
<p>Take a peek at all the other projects I've worked on. There's a some cool stuff here. Check it out!</p>
<a href="#" class="myButton"><i class="fa fa-search"></i>&nbsp;View</a>
</section>
</div>

这里有两个问题。

问题#1在浏览器宽度的某些点,布局变得不稳定并且我的行未对齐。在大约 960px 处不正确,然后在 1000px 处正确,然后在 1020px 处再次发生,然后再次更正。看照片:

Incorrect

问题#2当我将垂直对齐添加到容器时,容器正确地垂直居中,但容器向右移动了大约 10px,因此它没有水平居中。见照片。

Not Centered

非常感谢任何帮助。

最佳答案

.container {position:absolute;对于响应式网格?这对我来说似乎不太正确,但我不是专家,我还没有将您的 html 转移到我自己的编辑器中。

关于html - Susy 专栏正在崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25220596/

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