【问题标题】:I can't create the banner area the way I want. How can I do it? [closed]我无法按照我想要的方式创建横幅区域。我该怎么做? [关闭]
【发布时间】:2022-01-08 17:17:44
【问题描述】:

他们让我编辑横幅区域。我的实习生和前端知识不是很好。我在下面发布的照片​​中的横幅是两张独立的照片。我必须以相同的价值拟合产品的图片,并为每张照片提供单独的链接。但我无法在脑海中创建布局,也不知道该怎么做。如果您能提供一个想法,我将不胜感激。

这是应该的顺序:

我就是这样做的:

这里需要把产品的照片分开放,到顶的时候去单独的链接。我可以对他们提出任何问题,但我无法以这种方式下订单。目前一共有两张照片,所以它们不是单独的产品,它们都是一张照片。如果您能告诉我如何执行此操作,我将不胜感激。

HTML代码:

@{
    Layout = null;
}
<link href="~/Content/bscarousel.css" rel="stylesheet" />
<script src="~/Scripts/Home/Slider.js"></script>

<div ng-controller="SliderController">
    <div>
 <table border="0" bordercolor="#aaa" cellspacing="0" cellpadding="0" style="background-color:#4C8C9E;">
                <tr>
                    <td>
                        <a href="https://www.arkadasgrup.com/ListeArama/311/Seri">
                            <img class="img-responsive" src="~/images/ShamanKing.jpg" width="60%" height="120px;" /><p style="color:white;">Shaman King</p>
                        </a>
                    </td>
                      .
                      .
                      .
                </td>
            </tr>
        </table>
    </div>
</div>

如何整理所有照片?我正在尝试使它们都具有相同的大小,但我做不到。

CSS:

.carousel {
  position: relative;
}

.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-item {
  position: relative;
  display: none;
  align-items: center;
  width: 100%;
  @include transition($carousel-transition);
  backface-visibility: hidden;
  perspective: 1000px;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
  display: block;
}

.carousel-item-next,
.carousel-item-prev {
  position: absolute;
  top: 0;
}


.carousel-item-next.carousel-item-left,
.carousel-item-prev.carousel-item-right {
  transform: translateX(0);

  @supports (transform-style: preserve-3d) {
    transform: translate3d(0, 0, 0);
  }
}

.carousel-indicators {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  padding-left: 0; // override <ol> default
  margin-right: $carousel-control-width;
  margin-left: $carousel-control-width;
  list-style: none;

  li {
    position: relative;
    flex: 0 1 auto;
    width: $carousel-indicator-width;
    height: $carousel-indicator-height;
    margin-right: $carousel-indicator-spacer;
    margin-left: $carousel-indicator-spacer;
    text-indent: -999px;
    background-color: rgba($carousel-indicator-active-bg, .5);

    &::before {
      position: absolute;
      top: -10px;
      left: 0;
      display: inline-block;
      width: 100%;
      height: 10px;
      content: "";
    }
    &::after {
      position: absolute;
      bottom: -10px;
      left: 0;
      display: inline-block;
      width: 100%;
      height: 10px;
      content: "";
    }
  }

  .active {
    background-color: $carousel-indicator-active-bg;
  }
}

.carousel-caption {
  position: absolute;
  right: ((100% - $carousel-caption-width) / 2);
  bottom: 20px;
  left: ((100% - $carousel-caption-width) / 2);
  z-index: 10;
  padding-top: 20px;
  padding-bottom: 20px;
  color: $carousel-caption-color;
  text-align: center;
}

【问题讨论】:

  • HTML代码与CSS代码不对应
  • 另外,我并没有真正了解您想要开始的内容。 “我必须以相同的价值适合产品的图片” - 什么“产品”,什么“价值”?非常不清楚你在说什么。

标签: html css frontend


【解决方案1】:

鉴于没有可重现的代码,很难理解您的问题/问题。

如果您的目标是以均匀间距并排显示多个项目,您可以这样做:

HTML:

<div class="items">
  <img src="...">
  <img src="...">
  ...
</div>

CSS:

.items {
  display: flex;
  justify-content: space-evenly; /* this gives even space between items as shown in your image in the question */
}

.items img {
  width: 100px; /* you may want to define a fixed with here so that they all look the same */
}

【讨论】:

  • 是的,很遗憾,我无法完全解释我的问题,这令人困惑,但是您编写的代码确实对我有用,非常感谢。
猜你喜欢
  • 2011-01-22
  • 2016-08-16
  • 1970-01-01
  • 2012-02-11
  • 1970-01-01
  • 2022-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多