the positioning of the flexbox image on the right side is becoming unstable

https://i.sstatic.net/yx25q.pngI am currently working on creating a simple landing page layout based on a design in Figma. The main issue I am encountering has to do with the arrangement of images within a flexbox. Specifically, I have an image followed by a description and then another image, all in a single row line. However, the last image on the right side should take up 2/3 of the screen width while staying positioned immediately after the paragraph. I have attempted to use flex properties to achieve this layout, but so far, it hasn't worked as intended. The problem seems to stem from the "Main-content" div class in both the CSS and HTML files. I would greatly appreciate any advice or suggestions on how to resolve this issue. Thank you in advance.

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

header {
  display: flex;
  flex-wrap: wrap;
  width: 70%;
  margin: auto;
  align-items: center;
}

.logo {
  justify-content: flex-start;
  padding: 25px 15px 0px 0px;
}

.site-desc {
  width: 300px;
  justify-content: flex-end;
  padding: 30px 15px 0px 10px;
  font-size: 12px;
}

.contact-info {
  justify-content: flex-end;
  text-align: center;
  flex: 1;
  padding: 25px 0px 0px 0px;
}

.contact-info img {
  padding: 0px 5px 0px 0px;
}

.container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 70%;
  margin: auto;
}

.introduction {
  font-weight: 700;
  font-size: 30px;
  line-height: 45px;
  align-self: flex-start;
  padding: 30px 0px 0px 0px;
  width: 100%;
}

span {
  color: orangered;
}

.kitchen-types {
  padding: 30px 0px 0px 0px;
  font-size: 33px;
  align-self: flex-start;
  font-weight: 300;
}

.main-content {
  display: flex;
  flex-wrap: wrap;
  width: 70%;
  margin: auto;
  padding-top: 5rem;
  padding-left: 2.5rem;
  position: relative;
  height: 70vh;
  background: tomato;
  justify-content: flex-start;
  align-items: flex-start;
}

.left-side {
  position: relative;
}

.art-board {
  position: absolute;
  right: 100px;
  bottom: 185px;
}

.main-content-text {
  position: relative;
  font-size: 17px;
  padding: 15px 20px 0px 28px;
  line-height: 20px;
}

.arrow {
  position: absolute;
  bottom: 220px;
  right: 30rem;
}

.left-side-text {
  position: relative;
  padding-left: 15px;
}

.short-desc-2 {
  padding-top: 10px;
}

.yellow-checked {
  position: absolute;
}

.yellow-checked-2 {
  position: absolute;
  top: 30;
}

.yellow-checked-2,
.yellow-checked {
  right: 99%;
}

.main-content-text h4 {
  padding-bottom: 20px;
  width: 52%;
}

.left-side-cover {
  flex: 2;
}

.left-side-cover img {
  height: 30vh;
}
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="style.css">
  <title>Like Mebel</title>
</head>

<body>
  <header>
    <div class="logo">
      <img src="images/frame.svg" alt="frame">
    </div>
    <div class="site-desc">
      <p>Изготавливаем и устанавливаем кухни в Москве и области с 2004 года</p>
    </div>
    <div class="contact-info">
      <h2>+7 (995) 508-51-17</h2>
      <p><img src="images/online.svg">сейчас работаем</p>
    </div>
  </header>


  <main>
    <section class="container">
      <div class="introduction">

        <h2 class="text-color-type">
          Современные Комфортные Кухни <span><br/>с пожизненной гарантией</span>
        </h2>
        <h2 class="kitchen-types">Тренды дизайна кухни 2020 г.</h2>
      </div>

    </section>


    <div class="main-content">
      <div class="left-side">
        <img src="images/image163.png">
        <img class="art-board" src="images/Artboard21.png" alt="">
      </div>
      <div class="main-content-text">
        <h4>Максимальное использование пространства и простота в уходе</h4>
        <img class="arrow" src="images/Vector.png" alt="vector">
        <div class="left-side-text">
          <img class="yellow-checked" src="images/Group 839.png" alt="group">
          <p class="short-desc">Гладкие, ровные поверхности без ручек</p>
          <img class="yellow-checked-2" src="images/Group 839.png" alt="group">
          <p class="short-desc-2"> «Умные»‎ материалы фасадов —<br/> нет отпечатков и царапин</p>

        </div>

      </div>

      <div class="left-side-cover">

        <img src="images/Group87.png">
      </div>

    </div>

  </main>
</body>

</html>

Answer №1

Unfortunately, I am unable to provide a comment at this time. However, you could experiment with adding a width of auto; or matching the height value set for the image, as well as margin-bottom: auto; to adjust the styling.

<div class="left-side-cover">
 <img src="images/Group87.png">
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to create a table in CSS where one column has a fixed width and the other column adjusts automatically?

Currently, I am trying to create a table with resizable columns but have encountered a challenging issue. I want to allow the user to drag the side of a column to resize it and reset the width if needed. The problem arises when I need to reset one particul ...

The sticky navigation and scroll to top features both function perfectly on their own, but when used simultaneously, they do not work

I'm facing an issue with two scripts on my website - when they are separate, they work perfectly fine but together, they don't seem to function properly. What could I be missing here? Script 1: window.onscroll = function() {myFunction()}; var n ...

Adding a PHP file into an HTML page using JavaScript include

Recently, I was assigned to collaborate with a third-party vendor who displays movie times on their platform. We were given the opportunity to co-brand our website on their platform by creating a wrapper for our site. This wrapper would allow the movie tim ...

When inserting a page break after a section, it seamlessly flows to the next page during printing

When should the CSS properties page-break-after: always or before be used? I have tried various methods, such as creating different div elements for page-break, adjusting float and clear:both, but have not had any success. There are currently four section ...

Issues with Bootstrap 5 Carousel Control Button Functionality

My carousel isn't responding when I try to move it by touching the buttons. How can I fix this issue? Code: <div class="container mt-4"> <div id="carouselExampleIndicators" class="carousel slide" data-ri ...

Designing a submenu with HTML and CSS

As a novice in web development, I recently attempted to create a website featuring a horizontal main menu with a vertical submenu. However, I encountered an issue when hovering over a list item in the main menu - the submenu would drop down and disrupt th ...

Creating Custom GTK Themes using CSS3

Just a quick question: Can CSS3 be used to style GTK3 applications? ...

What is the best way to trigger click events within a select dropdown using Angular?

I have implemented two buttons (month, year) that trigger different events. Now, I want to replace these buttons with a select element. Can you guide me on how to achieve this? Here is my current code: // Button implementation <button class="menu-butt ...

After selecting a subitem, the side menu will automatically close

I designed a side menu that expands to reveal submenus. However, when I click on a subitem within a submenu, the entire list closes. The HTML, CSS, and JavaScript code all appear to be correct as the template is functioning properly. But as soon as I ins ...

Create clean and seamless column spacing in Bootstrap 4 without columns wrapping to the next line

Currently, I am attempting to find a solution for adding a small margin between my columns within the Bootstrap 4 grid system. I want there to be some space between each column, but without causing one of them to wrap onto the next line. Despite searching ...

Why aren't these div elements aligning with each other?

I am facing challenges in formatting these divs.... I have added borders around the divs to highlight the issue... I am aiming to align these divs similar to the second image, and I am puzzled as to why the top div is not aligning properly. My goal is for ...

The JQuery onchange event functions as expected multiple times within JSFiddle, but seems to only fire once in the

A jQuery (1.11.1) script has been implemented on a business catalyst site cart page to show or hide a message based on the dropdown option selected by the user. The script functions correctly multiple times in jsfiddle at http://jsfiddle.net/NathanHill/462 ...

AngularJS button within a Bootstrap navbar

I'm a fan of the current navigation bar style in Twitter Bootstrap v3.3.6 and I'm curious about how to integrate AngularJS buttons into it. <nav class="navbar navbar-default"> <div class="container"> <div ...

Eliminating date and time formatting in HTML emails on iPhones

I've designed an HTML email that is responsive and displays well on various platforms, but I'm encountering an issue specifically when viewing it on an iPhone. It appears that iOS is identifying a date and time in the content and applying a blue ...

Beautiful prompt interface for HTML

I'm attempting to create a sweet alert using the HTML option: swal({ title: "HTML <small>Title</small>!", text: "A custom <span style="color:#F8BB86">html<span> message.", html: true }); Instead of just text, ...

Is there a way to include a button within the Rails code that would allow users to add a present using the <%= link_to_add_fields "Add A Gift", f, :presents %> function

I'm having trouble figuring out how to insert a button into a link_to_add_fields, like this: <%= link_to_add_fields "Add Another Item", f, :items %> while working on my Rails App. I've attempted to include class: "btn btn-mini btn-info" ...

Navigating into the forbidden territory of the if block that holds secrets untold

Encountering an issue with the angularjs $location feature. I have set up an auth interpreter that redirects to the login page if a 401 error (unauthorised) is returned by the server. In my app.js file, both the auth interpreter and the account data loadin ...

Two divisions inside another "wrapper" division - Adjusting the width

I'm facing an issue with my CSS. I have a container div "container" that contains two other divs - "left" and "main". The width of the container is set to 90% of the body's width, with a margin of 3% auto to center it. .container{ margin:3% auto ...

Converting line breaks into a visible string format within Angular

After thorough research, all I've come across are solutions that demonstrate how to display the newline character as a new line. I specifically aim to exhibit the "\n" as a string within an Angular view. It appears that Angular disrega ...

Implement a Selection Feature in Angular

Currently, I am working on an application where users can add new rows with the same fields. One of the requirements is to allow users to add an option to a select element. While I have successfully implemented this in jQuery, I am facing challenges integr ...