首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >左右同时排列图像和文本

左右同时排列图像和文本
EN

Stack Overflow用户
提问于 2022-10-12 09:34:46
回答 4查看 181关注 0票数 0

我试图加载图片和引号左右垂直,但我有问题的第三张图片和引号。从某处,保证金css被添加,但我找不到问题。我已经给出了工作模式来解决我的问题,请检查一下!

工作网站

代码语言:javascript
复制
.float-left {
  float: right;
}

.next {
  margin: auto 25px;
  overflow: auto;
}

.flex {
  display: flex;
}
代码语言:javascript
复制
<div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
  <img src="./v-kart-restaurant-billing-software2.png" width="700" height="200" loading="lazy" />
  <div class="margin-10">
    <p>Simple dashboard for easy use of the pos software</p>
    <p>
      v-kart uses a simple and easy-to-use dashboard so that anyone will be able to use our software easily it has bigger buttons for easy and prolonged use of software
    </p>
  </div>
</div>

<div class="animate__animated animate__backInLeft animate__delay-1s float-left flex" loading="lazy">
  <div class="margin-10">
    <p>inventory for easy use of the billing software</p>
    <p>
      v-kart uses a simple and easy-to-use inventory which let you add new food items easily and edit the price details
    </p>
  </div>
  <img src="./v-kart-restaurant-billing-software-inventory-main.png" width="700" loading="lazy" />
</div>

<div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
  <img src="./v-kart-restaurant-billing-software-add-type-of-food.png" width="700" height="200" loading="lazy" />
  <div class="margin-10">
    <p>Easy to add a new type food type to our pos software</p>
    <p>
      our billing software is different from other pos systems because the software is dynamic and whenever a new type of dish has to be added to the software we can easily group them by adding a new type
    </p>
  </div>

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2022-10-16 08:03:14

我建议在这里与display:flexflex-flow合作。

这还允许为所有部分保留相同的HTML结构,这对于响应程序可能很有用。

代码语言:javascript
复制
.flex {
  display: flex;
}

.flex--left {
  flex-flow: row-reverse;
}

.content,
.image {
  width: 50%;
}
代码语言:javascript
复制
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet"/>

<div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
  <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software2.png" width="700" height="200" loading="lazy" class="image" />
  <div class="margin-10 content">
    <p>Simple dashboard for easy use of the pos software</p>
    <p>
      v-kart uses a simple and easy-to-use dashboard so that anyone will be able to use our software easily it has bigger buttons for easy and prolonged use of software
    </p>
  </div>
</div>

<div class="animate__animated animate__backInLeft animate__delay-1s flex flex--left" loading="lazy">
  <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-inventory-main.png" width="700" loading="lazy" class="image" />
  <div class="margin-10 content">
    <p>inventory for easy use of the billing software</p>
    <p>
      v-kart uses a simple and easy-to-use inventory which let you add new food items easily and edit the price details
    </p>
  </div>
</div>

<div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
  <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-add-type-of-food.png" width="700" height="200" loading="lazy" class="image" />
  <div class="margin-10 content">
    <p>Easy to add a new type food type to our pos software</p>
    <p>
      our billing software is different from other pos systems because the software is dynamic and whenever a new type of dish has to be added to the software we can easily group them by adding a new type
    </p>
  </div>
</div>

<div class="animate__animated animate__backInRight animate__delay-1s flex flex--left" loading="lazy">
  <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-loginpage.png" width="700" height="200" loading="lazy" class="image" />
  <div class="margin-10 content">
    <p>v-kart has high security features</p>
    <p>
      restaurant billing includes multiple billing users so we created the best security features for your software so the owner gets daily profit and loss correctly
    </p>
  </div>

票数 5
EN

Stack Overflow用户

发布于 2022-10-15 11:37:15

您只需要添加body > div:nth-child(3){float: left},或者:

代码语言:javascript
复制
.animate__animated.animate__backInRight.animate__delay-1s.flex {
    float: left;
}

它将正确地安排第三分舱。

以下是工作模式:

代码语言:javascript
复制
/*style.css*/

.float-left {
  float: right;
}

.next {
  margin: auto 25px;
  overflow: auto;
}

.flex {
  display: flex;
}


/*new code from here*/

.animate__animated.animate__backInRight.animate__delay-1s.flex {
  float: left;
}
代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
  <link rel="stylesheet" type="text/css" href="./style.css">
  <title>Document</title>
</head>

<body>
  <div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
    <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software2.png" width="700" height="200" loading="lazy">
    <div class="margin-10">
      <p>Simple dashboard for easy use of the pos software</p>
      <p>
        v-kart uses a simple and easy-to-use dashboard so that anyone will be able to use our software easily it has bigger buttons for easy and prolonged use of software
      </p>
    </div>
  </div>

  <div class="animate__animated animate__backInLeft animate__delay-1s float-left flex" loading="lazy">
    <div class="margin-10">
      <p>inventory for easy use of the billing software</p>
      <p>
        v-kart uses a simple and easy-to-use inventoy which let you add new food items easily and edit the price details
      </p>
    </div>
    <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-inventory-main.png" width="700" loading="lazy">
  </div>

  <div class="animate__animated animate__backInRight animate__delay-1s flex" loading="lazy">
    <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-add-type-of-food.png" width="700" height="200" loading="lazy">
    <div class="margin-10">
      <p>Easy to add a new type food type to our pos software</p>
      <p>
        our billing software is different from other pos systems because the software is dynamic and whenever a new type of dish has to be added to the software we can easily group them by adding a new type
      </p>
    </div>
  </div>

  <div class="animate__animated animate__backInLeft animate__delay-1s float-left flex" loading="lazy">
    <div class="margin-10">
      <p>v-kart has high security features</p>
      <p>
        restaurant billing includes multiple billing users so we created the best security features for your software so the owner gets daily profit and loss correctly
      </p>
    </div>
    <img src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-loginpage.png" width="700" loading="lazy">
  </div>


</body>

</html>

我用https://serene-cascaron-252692.netlify.app/代替了https://serene-cascaron-252692.netlify.app/,但您可以根据站点的需要对其进行更改。

票数 0
EN

Stack Overflow用户

发布于 2022-10-18 11:06:19

您唯一遇到的问题是float设置中的问题。如果我使用的是flex显示器,我不会设置浮动。

因此,我建议删除浮点,并使用flex的功能。我修改了您的css和html,以支持对齐html项/内容。我已经分开图像,并引用50%的集装箱,以使它看起来很好。随便绕着它玩吧。

另外,在给定的场景中,您不需要为图像设置一定的宽度,这样您的图像可能会经过它的父服务器,导致它触发卷轴或重叠文本。

代码语言:javascript
复制
.next {
  margin: auto 25px;
  overflow: auto;
}
.display-flex {
   display: flex;
}
.w-half {
   width: 50%;
}
.m-10px {
   margin: 10px;
}
.align-center{
   align-items: center;
}
代码语言:javascript
复制
<div class="animate__animated animate__backInRight animate__delay-1s display-flex align-center" loading="lazy">
  <img class="w-half" src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software2.png" loading="lazy" />
  <div class="w-half m-10px">
<p>Simple dashboard for easy use of the pos software</p>
<p>
  v-kart uses a simple and easy-to-use dashboard so that anyone will be able to use our software easily it has bigger buttons for easy and prolonged use of software
</p>
  </div>
</div>

<div class="animate__animated animate__backInLeft animate__delay-1s float-left display-flex align-center" loading="lazy">
  <div class="w-half m-10px">
<p>inventory for easy use of the billing software</p>
<p>
  v-kart uses a simple and easy-to-use inventory which let you add new food items easily and edit the price details
</p>
  </div>
  <img class="w-half" src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-inventory-main.png" loading="lazy" />
</div>

<div class="animate__animated animate__backInRight animate__delay-1s display-flex align-center" loading="lazy">
  <img class="w-half" src="https://serene-cascaron-252692.netlify.app/v-kart-restaurant-billing-software-add-type-of-food.png" loading="lazy" />
  <div class="w-half m-10px">
<p>Easy to add a new type food type to our pos software</p>
<p>
  our billing software is different from other pos systems because the software is dynamic and whenever a new type of dish has to be added to the software we can easily group them by adding a new type
</p>
  </div>
</div>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74039633

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档