html – How can I convert this flexbox contact form to CSS grid?

html – How can I convert this flexbox contact form to CSS grid? – Code Review Stack Exchange

Como centralizar grupo de imagens com flexbox

estou tentando centralizar as imagens usando o: justify-content: center; tentei de várias formas porém não consegui alguém pode dar uma força?
Quero que as imagens fique no centro da tela com margin-left: 20px, porém não estou conseguindo.

*{
    margin: 0;
    padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

.paidocontainjsjl {
    display: flex;

  flex-wrap: wrap;
    background-color: antiquewhite;
    padding-top: 90px;
    padding-bottom: 90px;
    font-family: 'Poppins', sans-serif;
}


#humcentrimmm {
position: absolute;
top: 30px;
left: 50%;
z-index: 1;
transform: translateX(-50%);
}

#humcentrimmm h1{
text-transform: uppercase;
font-weight: bold;
font-size: 37px;
}

.boxdaimgsds {
    position: relative;
    z-index: 10;
    width: 200px;
    margin: 0 auto;
}

.boxdaimgsds img {
    width: 200px;
    z-index: -99;
    margin-top: 40px;
}

.boxtexto {
    width: 200px;
    position: absolute;
    bottom: -20px;
    margin-top: -100px;
    background-color: salmon;
    padding-top: 10px;
    padding-bottom: 10px;
    text-align: center;
    color: #fff;
    font-size: 23px;
    font-weight: bold;
    z-index: 888;
    text-transform: uppercase;
}
.boxtexto::after {
    content: "";
  position: absolute;
  left: 0;
  bottom: 50px;
 background-color: salmon;
 clip-path: polygon(0 78%, 100% 93%, 100% 100%, 0% 100%);
 width: 100%;
 height: 100%;
}

@media (max-width:1087px) {
    .boxdaimgsds {
        margin-top: 50px;
    }

    #humcentrimmm  {
        top: 40px;
    }
    .boxdaimgsds img {
        width: 200px;
        z-index: -99;
        margin-top: 0px;
    }
    
}
  
<div class="paidocontainjsjl">
    <div id="humcentrimmm">
        <h1>Produtos</h1>
    </div>
        <div class="boxdaimgsds">
            <img src="https://www.w3schools.com/howto/img_avatar.png" alt="">
            <div class="boxtexto">Texto</div>
        </div>

        <div class="boxdaimgsds">
            <img src="https://www.w3schools.com/howto/img_avatar.png" alt="">
            <div class="boxtexto">Texto</div>
        </div>

        <div class="boxdaimgsds">
            <img src="https://www.w3schools.com/howto/img_avatar.png" alt="">
            <div class="boxtexto">Texto</div>
        </div>

        <div class="boxdaimgsds">
            <img src="https://www.w3schools.com/howto/img_avatar.png" alt="">
            <div class="boxtexto">Texto</div>
        </div>

    </div>  

inserir a descrição da imagem aqui

html – Flexbox column wrap não funciona como esperado

Estou tentando dividir uma página em 2 colunas. E na responsividade, apenas 1. Mas as sections estão ficando todas zoadas, não consigo entender porque.

Fiz o upload no CodePen pra facilitar a edição: https://codepen.io/arnonrdp/pen/YzpbBad

Sei que eu poderia utilizar uma div para cada coluna, mas isso me atrapalharia em planos futuros.

html – Making text in second div flexbox align evenly?

This is my actual code that works correctly:

body {
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
}

header.autoinfo {
background-color: black;
color: white;
padding: 43px;
margin-bottom: 20px;
}

footer {
margin-left: 140px;
}

.content {
width: 950px;
margin-left: 100px;
margin-right: 100px;
}

.flex-grid {
  display: flex;
  border: 2px solid;
}
  
.flex-grid .col {
  flex: 1;
}

.flex-grid-thirds {
  display: flex;
  justify-content: space-between;
}
.flex-grid-thirds .col {
  width: 32%;
}

 .price {
width: 50px;
text-align: right;
}

.col .vehicleinfo {
background-color: #FFFFFF;
}

.autoinfo {
background-color: red;
color: white;
}

.autoimg img {
background-color: #FFFFFF;
height: 240px;
}


@media (max-width: 400px) {
  .flex-grid,
  .flex-grid-thirds {
    display: block;
    .col {
      width: 100%;
      margin: 0 0 10px 0;
    }
  }
}




* {
  box-sizing: border-box;
}
body {
  padding: 20px;
}
.flex-grid { 
  margin: 0 0 20px 0;
}
.col {
  padding: 20px;
}

.sidebar {
    background-color: yellow;
    width: 90px;
    height: 600px;
    float: left;
    position: absolute;
    overflow: hidden;
    z-index: 99999;
    left: 0;
    top: -100;
    display: flex;
    margin-left: 20px;
    margin-right: 40px;
}

/* 
.sidebar {

  height: 9000px;
  overflow: hidden;
  display: flex;
background-color: yellow;
float: left;
margin-left: 20px;
margin-right: 40px;
}
 */
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Used Cars Chicago | City center cars cheaply</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<header class="autoinfo">
USED CARS CHICAGO
</header>

<div class="sidebar">
12
</div>

<div class="content">

<div class="flex-grid vehicleinfo">
  <div class="col autoimg"><img src="https://www.cstatic-images.com/car-pictures/xl/USC40BUC042C021001.png"></div>
  <div class="col"><h3>2017 Buick Regal 2.0T 1SV 4dr Sedan</h3>
  <p>Dark Sapphire Blue, 30,000 miles</p></div>
 <div class="col price"><h3>$19,990</h3></div> 
</div>

<div class="flex-grid vehicleinfo">
  <div class="col autoimg"><img src="https://www.cstatic-images.com/car-pictures/xl/CAC40MBC685A021001.png"></div>
  <div class="col"><h3>2017 Mercedes-Benz E400 Coupe 2dr</h3>
  <p>Brilliant Blue Metallic</p></div>
 <div class="col price"><h3>$43,990</h3></div> 
</div>

</div>

<footer>
Copyright 2021
</footer>

</body>
</html>

Depending on what size I make the image for .autoimg img the text goes onto another line, as seen with this example:

body {
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
}

header.autoinfo {
background-color: black;
color: white;
padding: 43px;
margin-bottom: 20px;
}

footer {
margin-left: 140px;
}

.content {
width: 950px;
margin-left: 100px;
margin-right: 100px;
}

.flex-grid {
  display: flex;
  border: 2px solid;
}
  
.flex-grid .col {
  flex: 1;
}

.flex-grid-thirds {
  display: flex;
  justify-content: space-between;
}
.flex-grid-thirds .col {
  width: 32%;
}

 .price {
width: 50px;
text-align: right;
}

.col .vehicleinfo {
background-color: #FFFFFF;
}

.autoinfo {
background-color: red;
color: white;
}

.autoimg img {
background-color: #FFFFFF;
height: 340px;
}


@media (max-width: 400px) {
  .flex-grid,
  .flex-grid-thirds {
    display: block;
    .col {
      width: 100%;
      margin: 0 0 10px 0;
    }
  }
}




* {
  box-sizing: border-box;
}
body {
  padding: 20px;
}
.flex-grid { 
  margin: 0 0 20px 0;
}
.col {
  padding: 20px;
}

.sidebar {
    background-color: yellow;
    width: 90px;
    height: 600px;
    float: left;
    position: absolute;
    overflow: hidden;
    z-index: 99999;
    left: 0;
    top: -100;
    display: flex;
    margin-left: 20px;
    margin-right: 40px;
}

/* 
.sidebar {

  height: 9000px;
  overflow: hidden;
  display: flex;
background-color: yellow;
float: left;
margin-left: 20px;
margin-right: 40px;
}
 */
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Used Cars Chicago | City center cars cheaply</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<header class="autoinfo">
USED CARS CHICAGO
</header>

<div class="sidebar">
12
</div>

<div class="content">

<div class="flex-grid vehicleinfo">
  <div class="col autoimg"><img src="https://www.cstatic-images.com/car-pictures/xl/USC40BUC042C021001.png"></div>
  <div class="col"><h3>2017 Buick Regal 2.0T 1SV 4dr Sedan</h3>
  <p>Dark Sapphire Blue, 30,000 miles</p></div>
 <div class="col price"><h3>$19,990</h3></div> 
</div>

<div class="flex-grid vehicleinfo">
  <div class="col autoimg"><img src="https://www.cstatic-images.com/car-pictures/xl/CAC40MBC685A021001.png"></div>
  <div class="col"><h3>2017 Mercedes-Benz E400 Coupe 2dr</h3>
  <p>Brilliant Blue Metallic</p></div>
 <div class="col price"><h3>$43,990</h3></div> 
</div>

</div>

<footer>
Copyright 2021
</footer>

</body>
</html>

I also can’t quite get the box to get image and text aligned evenly enough, but the code works well, and the template nearly does its job as intended.

This is what happens and isn’t quite the intended result:

Screencap

Any advice is welcomed on this, as I’m aiming for this with my flexbox layout:

Design of advert

only without the additional things, and for the text to be at the side as in the screenshot above:

This is intended as a simple-to-use template, and is nearly working; constructive criticism is welcomed.

css – Car sales platform HTML templates; making them work with flexbox?

I’ve created three HTML templatea, and they generally works for what I need it to be (a used vehicle sales platform); this uses flexbox.

I have three different templates, one stand-alone design and two which are similar versions of the same codebase:

body {
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  line-height: 18px;
}

header {
  margin-left: 20px;
  height: auto;
  width: 600px;
  padding: 40px;
  color: white;
  background-color: black;
  margin-bottom: 12px;
}

.sidebar {
  background-color: yellow;
  float: left;
  width: 100px;
  height: 400px;
}

.content {
  margin-left: 80px;
}

article.at1 {
  border: 3px solid;
  width: 800px;
}

.at1 {
  margin-bottom: 20px;
}

.container {
  display: grid;
  grid-template-columns: 700px 30px;
  grid-gap: -1rem;
  background-color: blue;
  color: white;
  margin-bottom: 10px;
}

.container2 {
  display: grid;
  grid-template-columns: 300px 300px;
  grid-gap: 3rem;
}

.container2>div:nth-child(1) {
  width: 90px;
  margin-left: 30px;
}

.container2>div:nth-child(2) {
  margin-right: 70px;
  width: 460px;
}

.container2>div img {
  display: inline-block;
  width: 300px;
  margin-right: 30px;
}

.container:nth-child(2) {
  float: right;
  width: 60%;
}

.container2:nth-child(2) {
  width: auto;
}

.price {
  width: 50px;
}
<body>
  <header>
    <H1>USED CARS OF LEEDS</H1>
    <h2>North Street, Leeds LS2</h2>
  </header>
  <div class="sidebar">
    Menu
  </div>
  <div class="content">
    <article class="at1">
      <div class="container">
        <div>
          2008 58 FORD MONDEO 2.3 ZETEC 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://d1ix0byejyn2u7.cloudfront.net/drive/images/made/drive/images/remote/https_ssl.caranddriving.com/f2/images/used/big/fordmondeo%202007-10_750_500_70.jpg"></div>
        <div>
          Silver, this example is in good condtion for its age!
        </div>
      </div>
    </article>
        <article class="at1">
    <div class="container">
        <div>
          2003 53 LAND ROVER FREELANDER 1.8i 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/2002-2003_Land_Rover_Freelander.jpg/1280px-2002-2003_Land_Rover_Freelander.jpg"></div>
        <div>
          blue, good condition
        </div>
      </div>
    </article>
    <article class="at1">
      <div class="container">
        <div>
          1989 G FORD IVECOCARGO EUROCARGO DROPSIDE PICKUP 4.3 TURBODIESEL 2dr 6.4t
        </div>
        <div class="price">
          £2,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/1999_Iveco-Ford_Cargo_75E15_5.9.jpg/1024px-1999_Iveco-Ford_Cargo_75E15_5.9.jpg"></div>
        <div>
          white, 100,000 km
        </div>
      </div>
    </article>
  </div>
</body>

</html>

The code for that works OK, but I’m making it more esthetically pleasing by adding webfonts.

However, where the main issues are relate to two things – getting the sidebar to work properly and have enough space and ensuring there’s space between sidebar and the contents of div.content.

This is my second template I designed, which uses flexbox as well, but in a slightly different way (the colors aren’t going to be that in the production version).

The code works as intended (flexbox displays), but the two major issues are getting everything to fit properly.

Version 1 (three-column flex within article tag):

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: #FFFFFF;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      width: 230px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
<body>
    <header>
      <h1>Leeds Used Cars</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
Content coming
</div>
<div class="content">
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/265121/1752x1168/02-mercedes-sprinter-13.jpg">
      </article>

      <article>
        <h3>2014 64 Mercedes-Benz Sprinter 313CDI High Roof Panel Van</h3>

        <p>Silver, 70,000 miles
      </article>

      <article>
        <h3>£19,000</h3>
      </article>
    </section>
    
   
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/201064/static-exterior/1752x1168/astra_3.jpg">
      </article>

      <article>
        <h3>2007 57 Vauxhall Astra 1.8 VVT Life 5dr</h3>

        <p>Silver, 170,000 miles
      </article>

      <article>
        <h3>£1,300</h3>
      </article>
    </section>
    
    </div>
    </body>

I also have an alternate version of this template where the product description is above the article tag:

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: aqua;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      height: 260px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
 <body>
    <header>
      <h1>Leeds Car Centre</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
owl
</div>
<div class="content">
   
        <section> 
      <article>
        <h2>2021 Compass Camino 660 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://wgp-cdn.co.uk/OAL/jpg/Camino-660-F_25cms-47523/500/500/">
      </article>   
      <article>
      4 berth, twin axle caravan, new
      </article>
    </section>
    
    
            <section> 
      <article>
        <h2>1989 G Porsche 911 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg/1024px-Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg">
      </article>   
      <article>
      black, good condition, a classic
      </article>
    </section>
  </body>

With these three, I want to make four major changes:

  • Make them look more professional

    Ensure there’s enough space between the sidebar

    Make sure the flexboxes work properly

    Have a version without sidebar

These are the four most important things.

I am looking for constructive criticism of these basic templates on how to improve them and make them more professional before any public release.

Any constructive criticism or code improvements are welcomed.

What I am looking to do is make the user interface one that is user-friendly; this is a sandbox test version in HTML before it’s ready for prime time.

accessibility – How to make flexbox and DIV work for a car sales template in HTML with sidebar and without sidebar?

I’ve created a HTML template, and it generally works for what I need it to be (a used vehicle sales platform); this uses flexbox.

I have three different templates, one stand-alone design and two which are similar versions of the same codebase:

body {
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  line-height: 18px;
}

header {
  margin-left: 20px;
  height: auto;
  width: 600px;
  padding: 40px;
  color: white;
  background-color: black;
  margin-bottom: 12px;
}

.sidebar {
  background-color: yellow;
  float: left;
  width: 100px;
  height: 400px;
}

.content {
  margin-left: 80px;
}

article.at1 {
  border: 3px solid;
  width: 800px;
}

.at1 {
  margin-bottom: 20px;
}

.container {
  display: grid;
  grid-template-columns: 700px 30px;
  grid-gap: -1rem;
  background-color: blue;
  color: white;
  margin-bottom: 10px;
}

.container2 {
  display: grid;
  grid-template-columns: 300px 300px;
  grid-gap: 3rem;
}

.container2>div:nth-child(1) {
  width: 90px;
  margin-left: 30px;
}

.container2>div:nth-child(2) {
  margin-right: 70px;
  width: 460px;
}

.container2>div img {
  display: inline-block;
  width: 300px;
  margin-right: 30px;
}

.container:nth-child(2) {
  float: right;
  width: 60%;
}

.container2:nth-child(2) {
  width: auto;
}

.price {
  width: 50px;
}
<body>
  <header>
    <H1>USED CARS OF LEEDS</H1>
    <h2>North Street, Leeds LS2</h2>
  </header>
  <div class="sidebar">
    Menu
  </div>
  <div class="content">
    <article class="at1">
      <div class="container">
        <div>
          2008 58 FORD MONDEO 2.3 ZETEC 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://d1ix0byejyn2u7.cloudfront.net/drive/images/made/drive/images/remote/https_ssl.caranddriving.com/f2/images/used/big/fordmondeo%202007-10_750_500_70.jpg"></div>
        <div>
          Silver, this example is in good condtion for its age!
        </div>
      </div>
    </article>
        <article class="at1">
    <div class="container">
        <div>
          2003 53 LAND ROVER FREELANDER 1.8i 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/2002-2003_Land_Rover_Freelander.jpg/1280px-2002-2003_Land_Rover_Freelander.jpg"></div>
        <div>
          blue, good condition
        </div>
      </div>
    </article>
    <article class="at1">
      <div class="container">
        <div>
          1989 G FORD IVECOCARGO EUROCARGO DROPSIDE PICKUP 4.3 TURBODIESEL 2dr 6.4t
        </div>
        <div class="price">
          £2,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/1999_Iveco-Ford_Cargo_75E15_5.9.jpg/1024px-1999_Iveco-Ford_Cargo_75E15_5.9.jpg"></div>
        <div>
          white, 100,000 km
        </div>
      </div>
    </article>
  </div>
</body>

</html>

The code for that works OK, but I’m making it more esthetically pleasing by adding webfonts.

However, where the main issues are relate to two things – getting the sidebar to work properly and have enough space and ensuring there’s space between sidebar and the contents of div.content.

This is my second template I designed, which uses flexbox as well, but in a slightly different way (the colors aren’t going to be that in the production version).

The code works as intended (flexbox displays), but the two major issues are getting everything to fit properly.

Version 1 (three-column flex within article tag):

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: #FFFFFF;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      width: 230px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
<body>
    <header>
      <h1>Leeds Used Cars</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
Content coming
</div>
<div class="content">
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/265121/1752x1168/02-mercedes-sprinter-13.jpg">
      </article>

      <article>
        <h3>2014 64 Mercedes-Benz Sprinter 313CDI High Roof Panel Van</h3>

        <p>Silver, 70,000 miles
      </article>

      <article>
        <h3>£19,000</h3>
      </article>
    </section>
    
   
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/201064/static-exterior/1752x1168/astra_3.jpg">
      </article>

      <article>
        <h3>2007 57 Vauxhall Astra 1.8 VVT Life 5dr</h3>

        <p>Silver, 170,000 miles
      </article>

      <article>
        <h3>£1,300</h3>
      </article>
    </section>
    
    </div>
    </body>

I also have an alternate version of this template where the product description is above the article tag:

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: aqua;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      height: 260px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
 <body>
    <header>
      <h1>Leeds Car Centre</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
owl
</div>
<div class="content">
   
        <section> 
      <article>
        <h2>2021 Compass Camino 660 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://wgp-cdn.co.uk/OAL/jpg/Camino-660-F_25cms-47523/500/500/">
      </article>   
      <article>
      4 berth, twin axle caravan, new
      </article>
    </section>
    
    
            <section> 
      <article>
        <h2>1989 G Porsche 911 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg/1024px-Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg">
      </article>   
      <article>
      black, good condition, a classic
      </article>
    </section>
  </body>

With these three, I want to make four major changes:

  • Make them look more professional

    Ensure there’s enough space between the sidebar

    Make sure the flexboxes work properly

    Have a version without sidebar

These are the four most important things.

I am looking for constructive criticism of these basic templates on how to improve them and make them more professional before any public release.

Any constructive criticism or code improvements are welcomed.

What I am looking to do is make the user interface one that is user-friendly; this is a sandbox test version in HTML before it’s ready for prime time.

html – I have created a flexbox site for a used vehicle sales platform; ensuring that bugs are ironed out before this is a production version

I’ve created a HTML template, and it generally works for what I need it to be (a used vehicle sales platform); this uses flexbox.

I have three different templates, one stand-alone design and two which are similar versions of the same codebase:

body {
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  line-height: 18px;
}

header {
  margin-left: 20px;
  height: auto;
  width: 600px;
  padding: 40px;
  color: white;
  background-color: black;
  margin-bottom: 12px;
}

.sidebar {
  background-color: yellow;
  float: left;
  width: 100px;
  height: 400px;
}

.content {
  margin-left: 80px;
}

article.at1 {
  border: 3px solid;
  width: 800px;
}

.at1 {
  margin-bottom: 20px;
}

.container {
  display: grid;
  grid-template-columns: 700px 30px;
  grid-gap: -1rem;
  background-color: blue;
  color: white;
  margin-bottom: 10px;
}

.container2 {
  display: grid;
  grid-template-columns: 300px 300px;
  grid-gap: 3rem;
}

.container2>div:nth-child(1) {
  width: 90px;
  margin-left: 30px;
}

.container2>div:nth-child(2) {
  margin-right: 70px;
  width: 460px;
}

.container2>div img {
  display: inline-block;
  width: 300px;
  margin-right: 30px;
}

.container:nth-child(2) {
  float: right;
  width: 60%;
}

.container2:nth-child(2) {
  width: auto;
}

.price {
  width: 50px;
}
<body>
  <header>
    <H1>USED CARS OF LEEDS</H1>
    <h2>North Street, Leeds LS2</h2>
  </header>
  <div class="sidebar">
    Menu
  </div>
  <div class="content">
    <article class="at1">
      <div class="container">
        <div>
          2008 58 FORD MONDEO 2.3 ZETEC 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://d1ix0byejyn2u7.cloudfront.net/drive/images/made/drive/images/remote/https_ssl.caranddriving.com/f2/images/used/big/fordmondeo%202007-10_750_500_70.jpg"></div>
        <div>
          Silver, this example is in good condtion for its age!
        </div>
      </div>
    </article>
        <article class="at1">
    <div class="container">
        <div>
          2003 53 LAND ROVER FREELANDER 1.8i 5dr
        </div>
        <div class="price">
          £6,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/2002-2003_Land_Rover_Freelander.jpg/1280px-2002-2003_Land_Rover_Freelander.jpg"></div>
        <div>
          blue, good condition
        </div>
      </div>
    </article>
    <article class="at1">
      <div class="container">
        <div>
          1989 G FORD IVECOCARGO EUROCARGO DROPSIDE PICKUP 4.3 TURBODIESEL 2dr 6.4t
        </div>
        <div class="price">
          £2,995
        </div>
      </div>
      <div class="container2">
        <div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/1999_Iveco-Ford_Cargo_75E15_5.9.jpg/1024px-1999_Iveco-Ford_Cargo_75E15_5.9.jpg"></div>
        <div>
          white, 100,000 km
        </div>
      </div>
    </article>
  </div>
</body>

</html>

The code for that works OK, but I’m making it more esthetically pleasing by adding webfonts.

However, where the main issues are relate to two things – getting the sidebar to work properly and have enough space and ensuring there’s space between sidebar and the contents of div.content.

This is my second template I designed, which uses flexbox as well, but in a slightly different way (the colors aren’t going to be that in the production version).

The code works as intended (flexbox displays), but the two major issues are getting everything to fit properly.

Version 1 (three-column flex within article tag):

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: #FFFFFF;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      width: 230px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
<body>
    <header>
      <h1>Leeds Used Cars</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
Content coming
</div>
<div class="content">
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/265121/1752x1168/02-mercedes-sprinter-13.jpg">
      </article>

      <article>
        <h3>2014 64 Mercedes-Benz Sprinter 313CDI High Roof Panel Van</h3>

        <p>Silver, 70,000 miles
      </article>

      <article>
        <h3>£19,000</h3>
      </article>
    </section>
    
   
    <section>
      <article class="imagebox">
        <img src="https://parkers-images.bauersecure.com/gallery-image/pagefiles/201064/static-exterior/1752x1168/astra_3.jpg">
      </article>

      <article>
        <h3>2007 57 Vauxhall Astra 1.8 VVT Life 5dr</h3>

        <p>Silver, 170,000 miles
      </article>

      <article>
        <h3>£1,300</h3>
      </article>
    </section>
    
    </div>
    </body>

I also have an alternate version of this template where the product description is above the article tag:

html {
        font-family: sans-serif;
      }

      body {
        margin: 0;
      }

      header {
        background: purple;
        height: auto;
        padding: 20px;
      }

      h1 {
        text-align: center;
        color: white;
        line-height: 100px;
        margin: 0;
      }

      article {
        padding: 10px;
        margin: 0px;
        background: aqua;
      }

      /* Add your flexbox CSS below here */

      section {
        margin-bottom: 10px;
        display: flex;
        flex-direction: row;
      }

      article {
      width: 700px;
      }
      
      article.imagebox img {
      height: 260px;
      }
      
      article.price {
      text-align: right;
      float: right;
      }
      
      .infog > article {
      background-color: #FFFFFF;
      }

.sidebar {
width: 200px;
height: 600px;
padding: 20px;
background-color: yellow;
float: left;
margin-right: 30px;
}
div.content {
margin-right: 300px;
height: 600px;
width: 800px;
padding: 20px;
margin-left: 20px;
}
 <body>
    <header>
      <h1>Leeds Car Centre</h1>
      <h2>Northgate Street, Leeds</h2>
    </header>
<div class="sidebar">
owl
</div>
<div class="content">
   
        <section> 
      <article>
        <h2>2021 Compass Camino 660 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://wgp-cdn.co.uk/OAL/jpg/Camino-660-F_25cms-47523/500/500/">
      </article>   
      <article>
      4 berth, twin axle caravan, new
      </article>
    </section>
    
    
            <section> 
      <article>
        <h2>1989 G Porsche 911 </h2>
      </article>    
      <article class="price">
        <h2>£23,000</h2>
      </article>
    </section>
            <section class="infog"> 
      <article class="imagebox">
        <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg/1024px-Porsche_911_%28964%29_Turbo_%2810317085456%29.jpg">
      </article>   
      <article>
      black, good condition, a classic
      </article>
    </section>
  </body>

With these three, I want to make four major changes:

  • Make them look more professional

    Ensure there’s enough space between the sidebar

    Make sure the flexboxes work properly

    Have a version without sidebar

These are the four most important things.

I am looking for constructive criticism of these basic templates on how to improve them and make them more professional before any public release.

Any constructive criticism or code improvements are welcomed.

Flexbox Horizontal List

Boa tarde pessoal!

Estou querendo alinhar uma lista ul de forma que seus li fiquem a esquerda e o último li fique a direita. Não estou conseguindo fazer isso, alguém poderia me ajudar.

Eu poderia fazer isso de forma mais fácil se eu separasse essa li dessa ul mas eu queria manter junto.

Tentei pôr o justify-self diretamente no úlimo também mas não deu
Eu tentei conforme segue abaixo e não deu certo:

HTML

 <ul class="lista-menu">
    <a><li class="funcionarios">Funcionários</li></a>
    <a href="clientes.html"><li class="clientes">Clientes</li></a>
    <a href="produtos.html"><li class="produtos">Produtos</li></a>
    <a href="servicos.html"><li class="servicos">Serviços</li></a>
    <a><li class="financeiro">Financeiro</li></a>
 </ul>

CSS

.lista-menu {
display: flex;
justify-content: flex-start;
width: 100%;
border: 1px solid black;
}

.financeiro {
  justify-self: flex-end;
}

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123