Как я могу создать угловой наклон и текст заголовка рядом с ним? - PullRequest
1 голос
/ 22 марта 2020

.image {
  min-height: 100vh;
}

.bg-image {
  background-image: url('https://picsum.photos/1440/900');
  background-size: cover;
  background-position: center;
}
<!--About Us -->
<div class="container-fluid">
  <div class="row no-gutter">
    <div class="d-none d-md-flex col-md-4 col-lg-6 bg-image"></div>
    <div class="col-md-8 col-lg-6 remove-padding">
      <div class="page d-flex align-items-center py-5">
        <div class="container">
          <div class="row">
            <div class="col-md-9 col-lg-8 mx-auto">
              <h1 class="heading">About Us</h1>
              <p class="content"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
                book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
                recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
              <p class="content">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
                survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
                desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
              </p>
              <p class="contents">
                Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
                survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
                desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
              </p>
              <a href="#" class="button">
                <button class="btn btn-primary" type="button" name="button">Click here</button>
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

Я пытаюсь сделать угловой дизайн , я пробовал использовать перекос, но он не работает на моем дизайне. Пожалуйста, обратитесь к этой строке кода ниже:

enter image description here

Ответы [ 2 ]

3 голосов
/ 22 марта 2020

Проверьте это, это может помочь вам начать:

Создайте div для нижеприведенного вида и добавьте свой текст или header внутри, то, что вам нужно использовать для угловой вещи, это linear-gradient и deg того, сколько вам нужно под углом.

#AboutUs {
  height: 30px;
  width:500px;
  background: linear-gradient(105deg, #DC8700 25%, #EDEDED 25%);
  border-style:dashed;
}
#text{
  margin-left:150px;
  height: 30px;
  width:190px;
  font-weight:bold;
  font-size:20px;
}
   <div id="AboutUs">
      <div id="text">About Us</div>
   </div>   

Надеюсь, это поможет.

0 голосов
/ 22 марта 2020

Так я бы сделал это, используя skewX, просто заменив h1 заголовком класса в вашем коде на:

<div class="about-heading">
   <div class="brown-skew"></div>
   <h1 class="heading">About Us</h1>
</div>

, а также добавив css:

.about-heading {
    height: 48px;
    display: flex;
    overflow: hidden;
    align-items: center;
}

.brown-skew {
    background-color: #DC8700;
    height: 4em;
    width: 6em;
    transform: skewX(-20deg);
    position: relative;
    left: -20px;
}
...