Click here to Skip to main content
15,886,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone tell me why it places the elements underneath each other and not next to each other?


HTML

<pre><!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="style copy.css">
  <title>Meine Website</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-circle-progress/1.2.2/circle-progress.min.js"></script>
</head>

<body>

<section id="skills">
    <div class="wrapper">
      <div class="card webdesign">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">WebDesign</div>
      </div>
      <div class="card egitarre">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">E-Gitarre</div>
      </div>
      <div class="card djing">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">Djing</div>
      </div>
      <div class="card editieren">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">Videobearbeitung</div>
      </div>
      <div class="card zeichnen">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">Zeichnen</div>
      </div>
      <div class="card editieren">
        <div class="circle">
          <div class="bar"></div>
          <div class="box"><span></span></div>
        </div>
        <div class="text">Videobearbeitung</div>
      </div>
    </div>

    <script>
      let options = {
        startAngle: -1.55,
        size: 150,
        value: 0.80,
        fill: {gradient: ['#091179', '#00d4ff']}
      }
      $(".circle .bar").circleProgress(options).on('circle-animation-progress',
      function(event, progress, stepValue){
        $(this).parent().find("span").text(String(stepValue.toFixed(2).substr(2)) + "%");
      });
      $(".egitarre .bar").circleProgress({
        value: 0.92
      });
      $(".djing .bar").circleProgress({
        value: 0.65
      });
      $(".editieren .bar").circleProgress({
        value: 0.87
      });
    </script>

  </section>

</body>

</html>

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


.wrapper{
  width: 250px;
  display: grid;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.wrapper .card{
  background: white;
  width: 250px;
  height: 300px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-direction: column;
  box-shadow: 0px 10px 15px rgba(0,0,0,0.1);
}
.wrapper .card .circle{
  position: relative;
  height: 150px;
  width: 150px;
  border-radius: 50%;
  cursor: default;
}
.card .circle .box,
.card .circle .box span{
  position: absolute;
  top: 50%;
  left: 50%;
}
.card .circle .box{
  height: 100%;
  width: 100%;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  transition: all 0.2s;
}
.card .circle:hover .box{
  transform: translate(-50%, -50%) scale(0.9);
}
.card .circle .box span,
.wrapper .card .text{
  background: -webkit-linear-gradient(left, #091179, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.circle .box span{
  font-size: 35px;
  font-family: sans-serif;
  font-weight: 600;
  transform: translate(-45%, -45%);
  transition: all 0.1s;
}
.card .circle:hover .box span{
  transform: translate(-45%, -45%) scale(1.1);
}
.card .text{
  font-size: 25px;

}

What I have tried:

I've tried to change the positions but it doesn't change :(
Posted
Updated 5-May-21 4:19am

"Next" to each other implies that you want a "tablular" format. Try adding a table.
Here is a reference that might help A Complete Guide to the Table Element | CSS-Tricks[^]
 
Share this answer
 
Different elements have different default ways of how the appear following other elements.

DIV for example goes to a new line
SPAN stays inline as part of its parent
These can be overridden with the display style.

If you wish to center a group of items you've put next to one another than you should wrap them in a DIV and center it - not the individual items.

You can check for further references here: W3Schools Online Web Tutorials[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900