Bootstrap 3colのパディングは削除できないようです

Mv27

パディングに大きな問題があります。私の問題の説明が意味をなす前に、インスペクターウィンドウに表示する2つのページがあります-そしてモバイルビューデバイスセクションを見てください:

1:このデモページは正常に機能しています。

2:このデモページは機能していません

2ページの違いは、3つの画像を含む行をもう1つ追加したことです。3枚の写真の行は、次のように基本的に構築されています。

<div class="row wrapping">
    <div class="col-sm-12">
        <div class="row">
            <div class="col-sm-8 margin_bottom">
                <!-- Picture 1 -->
            </div>
            <div class="col-sm-4">
                <div class="row">
                    <div class="col-sm-12 margin_bottom">
                        <!-- Picture 2 -->
                    </div>    
                </div>
                <div class="row">
                    <div class="col-sm-12 margin_bottom">
                        <!-- Picture 3 -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

私が見るように、内側の列にパディングが設定されていますcol > row > colか?そのパディングを削除するにはどうすればよいですか?以下のコードで行のパディングを削除し、それがすべての列にもカウントされると考えました。

.row.wrapping {
    margin-right: 0;
    margin-left: 0;
  }
    .wrapping > [class^="col-"], .wrapping > [class^=" col-"] {
      padding-right: 0;
      padding-left: 0;
  }

最も重要なことは、サイト全体がブートストラップで構築されているため、ブートストラップクラスの上書きを開始できないことです。したがって、ブートストラップフレームワークで上書きするすべての変更には、一意の名前を付ける必要があります。

#front .row {
  padding-bottom: 0px!important;
}

body {
  background-color: #f5f5f5;
}


/* Removes default right padding */

.row.wrapping {
  margin-right: 0;
  margin-left: 0;
}

.wrapping>[class^="col-"],
.wrapping>[class^=" col-"] {
  padding-right: 0;
  padding-left: 0;
}


/* Set width between grid elements */

.small-padding.top {
  padding-top: 10px;
}

.small-padding.bottom {
  padding-bottom: 10px;
}

.small-padding.left {
  padding-left: 5px;
}

.small-padding.right {
  padding-right: 5px;
}

.margin_bottom {
  margin-bottom: 10px;
}

.img-responsive {
  height: 100%;
}


/* Position of buttons/text in a single grid element */

.inner-wrapper {
  background: none;
}

.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.bottom-right {
  position: absolute;
  bottom: 8px;
  right: 16px;
}

.bottom-left {
  position: absolute;
  bottom: 2%;
  left: 6%;
}


/* Position text on full width banner */

.header-container {
  color: white;
  margin: 0 5%;
}

.banner-text {
  position: absolute;
  bottom: 3%;
  left: 1%;
  width: 80%;
}


/* Color on text */

.dark-font {
  color: #333;
}

.light-font {
  color: #fff;
  text-transform: uppercase;
}

.blue-font {
  color: #00a9ff;
  text-transform: uppercase;
  margin-top: -10px;
}


/* Set full width on columns */

@media (max-width: 768px) {
  .img-responsive {
    width: 100%;
    height: auto;
  }
  /* btn-success: */
  .btn-success {
    width: fit-content;
  }
}

@media (max-width: 991px) {
  h3 {
    font-size: 1.2em;
  }
}


/* Hover for grid elements that contains text */

.hovereffect {
  display: inline-block;
  overflow: hidden;
  position: relative;
  text-align: center;
  cursor: default;
}

.hovereffect .overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  overflow: hidden;
  top: 0;
  left: 0;
  transition: all 0.4s ease-in-out;
}

.hovereffect:hover .overlay {
  background-color: rgba(170, 170, 170, 0.4);
}

.hovereffect h2,
.hovereffect img {
  transition: all 0.4s ease-in-out;
}

.hovereffect img {
  display: block;
  position: relative;
  transform: scale(1.1);
}

.hovereffect:hover img {
  transform: scale(1);
}

.hovereffect h2 {
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  position: relative;
  font-size: 17px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.6);
}

.hovereffect p.info {
  text-decoration: none;
  color: #fff;
  border: 1px solid #fff;
  background-color: transparent;
  opacity: 0;
  transform: scale(1.5);
  transition: all 0.4s ease-in-out;
  font-weight: normal;
  height: 90%;
  width: 90%;
  top: 5%;
  /* (100% - 85%)/2 */
  left: 5%;
  position: absolute;
  text-align: left;
  padding: 20px 20px 20px 20px;
}

.hovereffect:hover p.info {
  opacity: 1;
  transform: scale(1);
  background-color: rgba(0, 0, 0, 0.4);
}


/* Hover fadeout head and subline */

.hovereffect:hover .inner-wrapper.bottom-left h3,
.hovereffect:hover .inner-wrapper.bottom-left span {
  transition: all 0.4s ease-in-out;
}

.hovereffect:hover .inner-wrapper.bottom-left h3,
.hovereffect:hover .inner-wrapper.bottom-left span {
  opacity: 0;
}


/* Hover opacity for grid elements without text*/

.column {
  padding: 0;
}

.column:last-child {
  padding-bottom: 60px;
}

.column::after {
  content: '';
  clear: both;
  display: block;
}

.column div {
  position: relative;
  float: left;
  width: 300px;
  height: 200px;
  margin: 0 0 0 25px;
  padding: 0;
}

.column div:first-child {
  margin-left: 0;
}

figure {
  margin: 0;
  padding: 0;
  background: #fff;
}

figure:hover+span {
  bottom: -36px;
  opacity: 1;
}


/* Opacity #1 */

.hover11 figure img {
  opacity: 1;
  -webkit-transition: .3s ease-in-out;
  transition: 0.8s ease-in-out;
}

.hover11 figure:hover img {
  opacity: .5;
}
<div class="wrapper">
  <div class="row wrapping">
    <div class="col-xs-12 col-sm-12 margin_bottom">
      <!--<div class="hover11 column">-->
      <a href="#">
        <picture>
          <source media="(min-width: 650px)" srcset="https://mimsi.dk/Static/Cms/d211428c-7ea9-4805-8b66-ee73d7f1df2d.jpg"></source>
          <source media="(min-width: 320px)" srcset="https://mimsi.dk/Static/Cms/b1cbb0f1-9e91-4d55-8a8e-65631432c38b.jpg"></source>
          <img src="http://mimsi.dk/Static/Cms/d211428c-7ea9-4805-8b66-ee73d7f1df2d.jpg" alt="mimsi Partnerværksteder" style="width:100%;"></img>
        </picture>
        <div class="inner-wrapper banner-text">
          <div class="header-container">
            <h2 class="blue-font" style="text-shadow: 2px 2px #000000;">Find nærmeste mimsi </h2>
            <p class="light-font" style="text-shadow: 2px 2px #000000;">#</p>
            <!--<span class="btn btn-primary" role="button">Lorem Ipsum</span>-->
          </div>
        </div>
      </a>
      <!--</div>-->
    </div>
  </div>
  <!-- DELETE THIS ROW IN THE INSPECT WINDOW -->
  <div class="row wrapping">
    <div class="col-sm-12">
      <div class="row">
        <a href="/da-dk/page/bmw-packages/">
          <div class="col-sm-8 margin_bottom">
            <div class="hover11 column">
              <figure>
                <picture>
                  <source media="(min-width: 650px)" srcset="https://mimsi.dk/Static/Cms/f30dfbf6-047a-4aa4-829f-48d4223d05be.jpg"></source>
                  <source media="(min-width: 320px)" srcset="https://mimsi.dk/Static/Cms/ce50c03a-0e95-4760-95a4-e2ad2a1b6e43.jpg"></source>
                  <img src="https://mimsi.dk/Static/Cms/f30dfbf6-047a-4aa4-829f-48d4223d05be.jpg" alt="Lorem Ipsum" style="width:100%;"></img>
                </picture>
              </figure>
            </div>
            <div class="inner-wrapper bottom-left">
              <h3 class="light-font" style="color:#333">Lorem Ipsum</h3>
              <span class="light-font" style="color:#00a9ff">Lorem Ipsum</span>
              <!--<button class="btn btn-success btn-lg">Læs mere</button>-->
            </div>
          </div>
        </a>
        <div class="col-sm-4">
          <div class="row">
            <a href="#">
              <div class="col-sm-12 margin_bottom">
                <div class="hover11 column">
                  <figure>
                    <img src="https://mimsi.dk/Static/Cms/7da4b142-e174-4dd4-aa44-cb175c1f92f0.jpg" alt="mimsi Lorem Ipsum" class="img-responsive"></img>
                  </figure>
                </div>
                <div class="inner-wrapper bottom-left">
                  <h4 class="light-font" style="color:#00a9ff">Vi er eneforhandler I Danmark</h4>
                  <span class="light-font">Lorem Ipsum</span>
                  <!--<button class="btn btn-success btn-lg">Læs mere</button>-->
                </div>
              </div>
            </a>
          </div>
          <div class="row">
            <a href="#">
              <div class="col-sm-12 margin_bottom">
                <div class="hover11 column">
                  <figure>
                    <a href="#" data-toggle="modal" data-target="#nyhedsbrev-tilmelding">
                      <img src="https://mimsi.dk/Static/Cms/d065fdf8-a5b1-4137-ba54-74c351185d36.jpg" alt="Signup newsletter" class="img-responsive"></img>
                    </a>
                  </figure>
                </div>
                <div class="modal fade" id="nyhedsbrev-tilmelding" role="dialog">
                  <div class="modal-dialog">
                    <div class="modal-content">
                      <div class="modal-body">
                        <div id="mc_embed_signup">

                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="inner-wrapper bottom-left"></div>
              </div>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

ジョイント

何を達成したいかはわかりませんが、https://koed.dk/da-dk/page/stackページで以下のように少し変更を加えると、効果は大きくなります。

.row.wrapping,
.row.wrapping .row {
    margin-left: -5px;
    margin-right: -5px;
}
.wrapping [class^=col-] {
    padding-left: 5px;
    padding-right: 5px;
}

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Bootstrap 4グリッドシステムの `col`にパディングがないのは正常ですか?

分類Dev

Bootstrapの100%divにパディングを追加するにはどうすればよいですか?

分類Dev

Apache Cassandra:auto_bootstrapプロパティにより、新しい(シードではない)ノードが別のDCのノードからデータをストリーミングできるようになりますか?

分類Dev

カントは、Bootstrap4の液体コンテナのパディングを取り除くようです

分類Dev

Bootstrap 3の折りたたまれたアコーディオンパネルをコンテンツの途中ではなく上部にロードするにはどうすればよいですか?

分類Dev

Bootstrap 3でリンク間のスペースを削除するにはどうすればよいですか?

分類Dev

マージン/パディングを与えることはcol-sm-nに影響を与えています。bootstrap4でこれを回避する方法

分類Dev

Bootstrap input-groupは、col-XX-Xからパディングを削除します

分類Dev

.containerの親を持つネストされたBootstrap.colのパディングを削除するためのベストプラクティスは何ですか?

分類Dev

これらの Bootstrap 3 パネルをインラインでレンダリングするにはどうすればよいですか?

分類Dev

Twitter Bootstrap 3のレスポンシブ機能を削除するにはどうすればよいですか?

分類Dev

フルグリフィコンセットがBootstrap3で機能しないのはなぜですか?

分類Dev

Bootstrap Jumbotron の左側のパディングが失われたのはなぜですか?

分類Dev

Bootstrap3の列からパディングを削除します

分類Dev

bootstrap.cssの.nav> li> aのパディングを直接変更せずに、Bootstrapナビゲーションバーのアイテム間のスペースを減らすにはどうすればよいですか?

分類Dev

Bootstrap行が要素にパディングを追加するのはなぜですか?

分類Dev

Bootstrap行が要素にパディングを追加するのはなぜですか?

分類Dev

Bootstrap3ツールチップは画像のパディングを削除します

分類Dev

Bootstrapアコーディオンの問題を修正するにはどうすればよいですか?

分類Dev

Bootstrap 4xリストのパディングはどこで定義されていますか?

分類Dev

ngx-bootstrapアコーディオングループの見出しにアイコンを追加するにはどうすればよいですか?

分類Dev

Bootstrap 3 Breadcrumbsのデフォルトのセパレータアイコンを変更するにはどうすればよいですか?

分類Dev

Bootstrap 3グリッドを使用するときにアイコンを垂直方向の中央に配置するにはどうすればよいですか?

分類Dev

Bootstrap 3のデフォルトの行の高さはどれくらいですか?1.428ではないようです

分類Dev

Bootstrapのcol-lg-*、col-md- *、col-sm- *の違いは何ですか?

分類Dev

Javascriptオブジェクトのプロパティを削除するにはどうすればよいですか?(BootsTrap ContexMenu var)

分類Dev

Bootstrap Carouselの空白を削除するにはどうすればよいですか?

分類Dev

列のパディングなしでBootstrap行の背景に色を付ける方法は?

分類Dev

非同期の問題が発生することなく、Bootstrapモーダルウィンドウが完全にロードされたときにDataTable jQueryプラグインをロードするにはどうすればよいですか?

Related 関連記事

  1. 1

    Bootstrap 4グリッドシステムの `col`にパディングがないのは正常ですか?

  2. 2

    Bootstrapの100%divにパディングを追加するにはどうすればよいですか?

  3. 3

    Apache Cassandra:auto_bootstrapプロパティにより、新しい(シードではない)ノードが別のDCのノードからデータをストリーミングできるようになりますか?

  4. 4

    カントは、Bootstrap4の液体コンテナのパディングを取り除くようです

  5. 5

    Bootstrap 3の折りたたまれたアコーディオンパネルをコンテンツの途中ではなく上部にロードするにはどうすればよいですか?

  6. 6

    Bootstrap 3でリンク間のスペースを削除するにはどうすればよいですか?

  7. 7

    マージン/パディングを与えることはcol-sm-nに影響を与えています。bootstrap4でこれを回避する方法

  8. 8

    Bootstrap input-groupは、col-XX-Xからパディングを削除します

  9. 9

    .containerの親を持つネストされたBootstrap.colのパディングを削除するためのベストプラクティスは何ですか?

  10. 10

    これらの Bootstrap 3 パネルをインラインでレンダリングするにはどうすればよいですか?

  11. 11

    Twitter Bootstrap 3のレスポンシブ機能を削除するにはどうすればよいですか?

  12. 12

    フルグリフィコンセットがBootstrap3で機能しないのはなぜですか?

  13. 13

    Bootstrap Jumbotron の左側のパディングが失われたのはなぜですか?

  14. 14

    Bootstrap3の列からパディングを削除します

  15. 15

    bootstrap.cssの.nav> li> aのパディングを直接変更せずに、Bootstrapナビゲーションバーのアイテム間のスペースを減らすにはどうすればよいですか?

  16. 16

    Bootstrap行が要素にパディングを追加するのはなぜですか?

  17. 17

    Bootstrap行が要素にパディングを追加するのはなぜですか?

  18. 18

    Bootstrap3ツールチップは画像のパディングを削除します

  19. 19

    Bootstrapアコーディオンの問題を修正するにはどうすればよいですか?

  20. 20

    Bootstrap 4xリストのパディングはどこで定義されていますか?

  21. 21

    ngx-bootstrapアコーディオングループの見出しにアイコンを追加するにはどうすればよいですか?

  22. 22

    Bootstrap 3 Breadcrumbsのデフォルトのセパレータアイコンを変更するにはどうすればよいですか?

  23. 23

    Bootstrap 3グリッドを使用するときにアイコンを垂直方向の中央に配置するにはどうすればよいですか?

  24. 24

    Bootstrap 3のデフォルトの行の高さはどれくらいですか?1.428ではないようです

  25. 25

    Bootstrapのcol-lg-*、col-md- *、col-sm- *の違いは何ですか?

  26. 26

    Javascriptオブジェクトのプロパティを削除するにはどうすればよいですか?(BootsTrap ContexMenu var)

  27. 27

    Bootstrap Carouselの空白を削除するにはどうすればよいですか?

  28. 28

    列のパディングなしでBootstrap行の背景に色を付ける方法は?

  29. 29

    非同期の問題が発生することなく、Bootstrapモーダルウィンドウが完全にロードされたときにDataTable jQueryプラグインをロードするにはどうすればよいですか?

ホットタグ

アーカイブ