help me with html/css

sjkun

New member
Jan 23, 2021
12
1
3
i need ur help, babiato users :)
I need to write this part of the site with this arrangement of elements.

U2KOd.png

I can only do this.
U2KS8.png



Code:
html
<section id="road">
        <h1 class="troad">Путь к обновленному автомобилю</h1>
          <div class="layout">
            <div class="fline">
              <div><h1 class="num">1</h1></div><div class="cell"><p>text 1</p></div>
              <div><h1 class="num">3</h1></div><div class="cell"><p>text 3</p></div>
            </div>
            <div class="sline">
              <div><h1 class="num">2</h1></div><div class="cell"><p>text 2</p></div>
              <div><h1 class="num">4</h1></div><div class="cell"><p>text 4</p></div>
            </div>
          </div>
</section>

css

#road {
  background-image: url("https://kudesniki.xyz/assets/images/road.png");
  background-size: cover;
  -webkit-background-size: cover;
  background-repeat: no-repeat;
  padding: 0;
  margin: 0;
}

.troad  {
  color: black;
  font-size: 36px;
  margin: 40px;
  padding: 30px 0 0 60px;
}

.num {
  color: #AE2929;
  font-size: 100px;
}

.fline {
  display: inline-flex;
  margin-left: 60px;
  float: left;
  justify-content: center;

}

.sline {
  display: inline-flex;
}
 

jackdanielz

New member
May 5, 2022
24
11
3
This is just written on the fly. @media screen is only as a demo.

<html>
<head>
<style>
body {margin: 0; display: flex; align-items: center; flex-direction: column;}
.wrapper {display: flex; flex-wrap: wrap; width: 100vw;}
.layout {display: flex; flex-wrap: wrap; padding: 6vw; background:black;}
.column {display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 50px 10px; height: 100px;}
.column:nth-of-type(1), .column:nth-of-type(3), .column:nth-of-type(5), .column:nth-of-type(7) {width: calc(10vw - 0px); color: red;}
.column:nth-of-type(2), .column:nth-of-type(4), .column:nth-of-type(6), .column:nth-of-type(8) {width: calc(30vw - 0px); color: white; background: grey;}
#road {background-image: url("https://kudesniki.xyz/assets/images/road.png"); background-size: cover; -webkit-background-size: cover; background-repeat: no-repeat; padding: 0; margin: 0;}
.num {color: red; font-size: 200px;}
.troad {color: black; font-size: 36px; margin: 40px; padding: 30px 0 0 60px;}
@media screen and (max-width:999px) {
.column:nth-of-type(1), .column:nth-of-type(3), .column:nth-of-type(5), .column:nth-of-type(7) {width: calc(20vw - 0px); color: red;}
.column:nth-of-type(2), .column:nth-of-type(4), .column:nth-of-type(6), .column:nth-of-type(8) {width: calc(60vw - 0px); color: white; background: grey;}
}
</style>
</head>
<body>
<section id="road">
<h1 class="troad">Путь к обновленному автомобилю</h1>
<div class="wrapper">
<div class="layout">
<div class="column"><h1 class="num">1</h1></div>
<div class="column"><p>Text 1</p></div>
<div class="column"><h1 class="num">2</h1></div>
<div class="column"><p>Text 2</p></div>
<div class="column"><h1 class="num">3</h1></div>
<div class="column"><p>Text 3</p></div>
<div class="column"><h1 class="num">4</h1></div>
<div class="column"><p>Text 4</p></div>
</div>
</div>
</section>
</body>
</html>
 
Last edited:
  • Love
Reactions: sjkun

sjkun

New member
Jan 23, 2021
12
1
3
This is just written on the fly. @media screen is only as a demo.

<html>
<head>
<style>
body {margin: 0; display: flex; align-items: center; flex-direction: column;}
.wrapper {display: flex; flex-wrap: wrap; width: 100vw;}
.layout {display: flex; flex-wrap: wrap; padding: 6vw; background:black;}
.column {display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 50px 10px; height: 100px;}
.column:nth-of-type(1), .column:nth-of-type(3), .column:nth-of-type(5), .column:nth-of-type(7) {width: calc(10vw - 0px); color: red;}
.column:nth-of-type(2), .column:nth-of-type(4), .column:nth-of-type(6), .column:nth-of-type(8) {width: calc(30vw - 0px); color: white; background: grey;}
#road {background-image: url("https://kudesniki.xyz/assets/images/road.png"); background-size: cover; -webkit-background-size: cover; background-repeat: no-repeat; padding: 0; margin: 0;}
.num {color: red; font-size: 200px;}
.troad {color: black; font-size: 36px; margin: 40px; padding: 30px 0 0 60px;}
@media screen and (max-width:999px) {
.column:nth-of-type(1), .column:nth-of-type(3), .column:nth-of-type(5), .column:nth-of-type(7) {width: calc(20vw - 0px); color: red;}
.column:nth-of-type(2), .column:nth-of-type(4), .column:nth-of-type(6), .column:nth-of-type(8) {width: calc(60vw - 0px); color: white; background: grey;}
}
</style>
</head>
<body>
<section id="road">
<h1 class="troad">Путь к обновленному автомобилю</h1>
<div class="wrapper">
<div class="layout">
<div class="column"><h1 class="num">1</h1></div>
<div class="column"><p>Text 1</p></div>
<div class="column"><h1 class="num">2</h1></div>
<div class="column"><p>Text 2</p></div>
<div class="column"><h1 class="num">3</h1></div>
<div class="column"><p>Text 3</p></div>
<div class="column"><h1 class="num">4</h1></div>
<div class="column"><p>Text 4</p></div>
</div>
</div>
</section>
</body>
</html>
thank you!!!!!
 
  • Like
Reactions: jackdanielz

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu