【问题标题】:What is the CSS to change the width of sidebar?改变侧边栏宽度的 CSS 是什么?
【发布时间】:2020-01-31 09:58:27
【问题描述】:

我想更改右侧边栏的宽度。右侧空间太大,与左侧/中心的主要信息/图像太近。

我已经查看了这里的所有答案并尝试了所有 css 建议。它们不会产生任何运动或变化。

网站页面图片链接:

https://ibb.co/R2Cfvvv

【问题讨论】:

标签: css wordpress woocommerce sidebar


【解决方案1】:

您的主要内容宽度:

@media only screen and (min-width: 768px) {
.col-md-8, .tt_event_page_left, .woocommerce .woocommerce-cart-form {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 66.66667%;
    flex: 0 0 66.66667%;
    max-width: 66.66667%;
} }

您的侧边栏内容宽度:

@media only screen and (min-width: 768px) {
.col-md-4, .tt_event_page_right, .woocommerce .cart-collaterals {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 33.33333%;
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
} }

因此,根据您的需要调整值,如果您想向侧边栏添加填充,请添加 padding-left 属性。 示例:

@media only screen and (min-width: 768px) {
.col-md-4, .tt_event_page_right, .woocommerce .cart-collaterals {
padding-left: 75px;
} }

【讨论】:

  • @Christal 很高兴为您提供帮助!如果它解决了您的问题,请将我的回答标记为“已接受”(复选标记)。
猜你喜欢
  • 1970-01-01
  • 2023-03-30
  • 1970-01-01
  • 2015-01-12
  • 2013-10-16
  • 2016-10-13
  • 1970-01-01
  • 2013-03-10
  • 2016-12-23
相关资源
最近更新 更多