justify-content: center; and height: fit-content; won't work

141 views Asked by At

Won't center and won't adjust the height only with text

I tried to center items and adjust the height of the divs to text but right div won't work well I do not know why I cant adjust the content with height: fit-content cuz I did not specify the heights of the divs in style.

body {
  font-family: sans-serif;
  background-color: #FAF9F6;
  color: #333;
  line-height: 1.4;
}

.container {
  max-width: 1280px;
  height: fit-content;
  justify-content: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.containers {
  padding: 20px;
  border-style: ridge;
  border-color: antiquewhite;
  background-color: white;
  transition: box-shadow .3s;
}

.left {
  flex: 1;
  margin-right: 5px;
}

.left img {
  display: block;
  width: 100%;
  margin-bottom: 30px;
  transition: 0.8s;
}

.left img:hover {
  transform: scale(1.05);
}

.left h1 {
  margin-bottom: 20px;
}

.left p {
  margin-bottom: 10px;
}

.right {
  flex: 2;
  margin-left: 5px;
}

.right h2 {
  margin-bottom: 20px;
}

.right h3 {
  margin-bottom: 10px;
}

.right p {
  margin-bottom: 10px;
}

.right a {
  text-decoration: none;
  color: #333;
  border-bottom: 2px solid #333;
  padding-bottom: 2px;
}

.right a {
  box-shadow: inset 0 0 0 0 #54b3d6;
  color: black;
  margin: 0 -.25rem;
  padding: 0 .25rem;
  transition: color .3s ease-in-out, box-shadow .3s ease-in-out;
}

.right a:hover {
  box-shadow: inset 250px 0 0 0 #54b3d6;
  color: white;
}

.prvih1 {
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  text-shadow: #54b3d6;
}

.slika {
  width: 100%;
}

.pprvi {
  display: block;
  font-style: italic;
  margin-top: 10px;
  margin-bottom: 10px;
}

.ikoneitext {
  text-align: left;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

hr {
  margin-top: 50px;
  margin-bottom: 20px;
  height: 1px;
  width: 90%;
  background-color: antiquewhite;
}

.right:hover {
  box-shadow: 0 0 50px rgba(33, 33, 33, .2);
}

.left:hover {
  box-shadow: 0 0 50px rgba(33, 33, 33, .2);
}

.ikoneijezik {
  text-align: left;
  font-family: 'Courier New', Courier, monospace;
}

i {
  display: block;
  color: rgb(0, 119, 255);
  margin-right: 10px;
}

.languagediv {
  display: inline-block;
  font-size: 30px;
  font-family: font Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  padding-bottom: 5px;
  background-image: linear-gradient(#000 0 0);
  background-position: 0 100%;
  background-size: 0% 2px;
  background-repeat: no-repeat;
  transition: background-size 0.3s, background-position 0s 0.3s;
}

.languagediv:hover {
  background-position: 100% 100%;
  background-size: 100% 2px;
}

.skillsdiv {
  display: inline-block;
  font-size: 30px;
  font-family: font Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  padding-bottom: 5px;
  background-image: linear-gradient(#000 0 0);
  background-position: 0 100%;
  background-size: 0% 2px;
  background-repeat: no-repeat;
  transition: background-size 0.3s, background-position 0s 0.3s;
}

.skillsdiv:hover {
  background-position: 100% 100%;
  background-size: 100% 2px;
}

.educationdiv {
  display: inline-block;
  font-size: 30px;
  font-family: font Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  padding-bottom: 5px;
  background-image: linear-gradient(#000 0 0);
  background-position: 0 100%;
  background-size: 0% 2px;
  background-repeat: no-repeat;
  transition: background-size 0.3s, background-position 0s 0.3s;
}

.educationdiv:hover {
  background-position: 100% 100%;
  background-size: 100% 2px;
}

span {
  color: rgb(0, 119, 255);
}

.divlista1 {
  display: block;
  text-align: left;
}

.h4odul {
  font-size: 20px;
}

.divlista2 {
  display: block;
  text-align: left;
}

.drugih4odul {
  font-size: 20px;
}
0

There are 0 answers