【问题标题】:CSS Responsive Mobile Issue - Foundation Front-end framework ( ZURB)CSS 响应式移动问题 - 基础前端框架 (ZURB)
【发布时间】:2023-12-03 23:35:01
【问题描述】:

我的网站为我的网站使用 Foundation Front-end 框架,因此它是针对移动设备的响应式设计。

我有一个问题,即在移动设备上使用数据时如何在我的网站上显示数据。

我希望我网站上的侧边栏小部件内容显示在移动版网站上的项目(健身俱乐部)上方。看到我的侧边栏小部件有一个过滤器部分,所以我真的需要在(健康俱乐部)之前显示它。

问题:我需要更改哪些内容才能在顶部显示侧边栏小部件?抱歉,我的 CSS 没问题,但这对于我的技能水平来说已经相当先进了。

这是网站:(PC 版) http://s10.postimg.org/cl1n43w95/website.png

这是网站在移动设备上的显示方式。注意我的项目都在侧边栏上方。我想要项目上方的侧边栏小部件:

http://s27.postimg.org/8adw402gz/screenshot2_sidebarunder_items.png

这是我认为我需要更改的基础代码:

/* #Foundation Style
================================================== */
.row .column, .row .columns{ -webkit-box-sizing: border-box; -moz-box-sizing: border-box;        box-sizing: border-box; }

.container{ margin: 0px auto; max-width: 960px; padding: 0px 20px; }
.container.wrapper{ margin: 0px auto; max-width: 1000px; padding: 0px; }

.row { width: 1140px; max-width: 100%; min-width: 727px; margin: 0 auto; }
.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -10px; }

.column, .columns { float: left; min-height: 1px; padding: 0 10px; position: relative;        margin-bottom: -12px; }

.row .one { width: 8.333%; }
.row .two { width: 16.667%; }
.row .three { width: 25%; }
.row .four { width: 33.333%; }
.row .five { width: 41.667%; }
.row .six { width: 50%; }
.row .seven { width: 58.333%; }
.row .eight { width: 66.667%; }
.row .nine { width: 75%; }
.row .ten { width: 83.333%; }
.row .eleven { width: 91.667%; }
.row .twelve { width: 100%; }

.row .one-fifth{ width: 20%; }
.row .one-sixth{ width: 16.667; }

img{ max-width: 100%; height: auto; }
img { -ms-interpolation-mode: bicubic; }
object, embed { max-width: 100%; }

/* #Foundation Mobile Size
================================================== */
@media only screen and (max-width: 767px) {
    body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none;
        width: 100%; min-width: 0; margin-left: 0; margin-right: 0; padding-left: 0;     padding-right: 0; }

.container{ margin: 0px auto; max-width: 420px; }
.container.wrapper{ margin: 0px auto; max-width: 460px; padding: 0px; }

.row { width: auto; min-width: 0; margin-left: 0; margin-right: 0; }

.row .column, .row .columns { width: 100%; float: none; }

.column:last-child, .columns:last-child { float: none; }
[class*="column"] + [class*="column"]:last-child { float: none; }

.column:before, .columns:before, .column:after, .columns:after { content: ""; display:         table; }
.column:after, .columns:after { clear: both; }
}

/* #Custom Style
================================================== */

/*--- header area ---*/
.header-wrapper .responsive-menu-wrapper{ display: none; }

/* #Custom Mobile size
================================================== */
@media only screen and (max-width: 767px) {
/*--- header area ---*/
.header-wrapper .logo-wrapper{ float: none; }
.header-wrapper .navigation-wrapper{ display: none; }
.header-wrapper .responsive-menu-wrapper{ display: block; }     
.header-wrapper .top-search-form{ display: none; }

div.logo-right-text{ float: none !important; text-align: center !important; 
    padding-top: 0px !important; padding-bottom: 20px; }

div.feedback-wrapper{ display: none; }

div.top-navigation-left, div.top-navigation-right{ text-align: center; float: none; }
div.social-wrapper { float: none; display: inline-block; margin-top: 5px; }

/*--- single page ---*/
div.single-portfolio .port-media-wrapper { max-width: 100%; width: 100%; float: none;     margin-bottom: 20px; }
div.single-portfolio .port-content-wrapper { overflow: visible; }
div.single-portfolio .port-nav .port-prev-nav, div.single-portfolio .port-nav .port-next-    nav { margin-bottom: 15px; }

/*--- page item ---*/
div.gdl-blog-medium .blog-media-wrapper { margin-right: 0px; width: 100%; }
div.gdl-blog-medium .blog-context-wrapper { overflow: visible; }
div.price-item{ margin-bottom: 20px; }

div.column-service-row{ border-left-width: 0px; }

/*--- shortcode ---*/
.shortcode1-4, .shortcode1-4.last, 
.shortcode1-3, .shortcode1-3.last, 
.shortcode1-2, .shortcode1-2.last,
.shortcode2-3, .shortcode2-3.last, 
.shortcode3-4, .shortcode3-4.last,
.shortcode1-5, .shortcode1-5.last, 
.shortcode2-5, .shortcode2-5.last,
.shortcode3-5, .shortcode3-5.last, 
.shortcode4-5, .shortcode4-5.last{ width: 100%; }

/*--- slider ---*/
.flex-caption{ display: none !important; }
.nivo-caption{ display: none !important; }
.anythingSlider{ display: none !important; }

/*--- footer ---*/
div.copyright-left, div.copyright-right{ float: none; text-align: center; }
}

谢谢各位,如果我不是很清楚,对不起。

【问题讨论】:

  • 对不起,如果我不清楚。我不知道在哪里寻找这个问题的代码。

标签: html css responsive-design zurb-foundation


【解决方案1】:

使用基础网格,您可以更改列的顺序,这可能就是您要寻找的。​​p>

http://foundation.zurb.com/docs/components/grid.html

查找“源排序”

这应该会引导您走上正确的道路。否则,如果您发布相关标记会很有帮助。

第二次尝试

如果您查看第二页的来源http://goo.gl/ijZ1JF,您会发现三个元素:

<div class="row single page"> ...

<div class="eight column columnopaddingright"> ...

<div class="four column  columnopaddingleft"> ...

如果你为了测试目的而修改它们,你会得到想要的结果吗?

<div class="row single page" style="display: table;">

<div class="eight column columnopaddingright" style="display: table-footer-group;">

<div class="four column  columnopaddingleft" style="display: table-header-group;">

【讨论】:

  • 谢谢一百万!!我实际上是在尝试在代码中找到对 Source Ordering 的引用。请参阅我正在使用网站模板,所以我觉得它很棘手。
  • 我在用wordpress,这很混乱
  • 我有一个指向我的网站的链接。 goo.gl/bQ3DCF 如果有用的话。该模板仅供购买,但如果您使用的是保管箱或谷歌驱动器 ID,我们很乐意将副本发送给您以供审核。谢谢
  • 我明白了,忘记我的答案。您的模板未使用基础框架。我首先误解了你的问题。
  • 很抱歉 Jens W。感谢您抽出宝贵时间提供帮助,非常感谢。