# Justify Content Issues

**URL:** https://forum.kirupa.com/t/justify-content-issues/645678
**Category:** Uncategorized
**Created:** [January 12, 2021, 4:25pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678 "2021-01-12T16:25:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)
#### Post date: [January 12, 2021, 4:25pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678/1 "2021-01-12T16:25:52Z")

</div>

I have a container with 3 items. I am testing the following values for the justify-content property -  
flex-start (works as it should positioning all items to the LS of the container)  
flex-end(also works as it should placing the items to the RS)  
flex-center(doesn’t do what it should - elements are still on the LS - I can’t understand why this is so)

 Document .container { width: 600px; height: 800px; border: 4px solid black; display: flex; justify-content: flex-center; text-align: center; }

```
.orange {
  height: 80px;
  width: 80px;
  background: orange;
  
}

.green {
  height: 110px;
  width: 110px;
  background: green;
  
  color: white
}

.red {
  height: 140px;
  width: 140px;
  background: red;
  
  color:rgb(253, 249, 1)
}

```

orange

green

red

---

<div class="post-metadata">

### Author: ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)
#### Post date: [January 12, 2021, 4:27pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678/2 "2021-01-12T16:27:25Z")

</div>

sorry - here’s the code - I don’t know why it didn’t come across fully in the original post

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

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container {
      width: 600px;
      height: 800px;
      border: 4px solid black;
      display: flex;
      justify-content: flex-center;
      text-align: center;
    }

    .orange {
      height: 80px;
      width: 80px;
      background: orange;
      
    }

    .green {
      height: 110px;
      width: 110px;
      background: green;
      
      color: white
    }

    .red {
      height: 140px;
      width: 140px;
      background: red;
      
      color:rgb(253, 249, 1)
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="orange">orange</div>
    <div class="green">green</div>
    <div class="red">red</div>
  </div>
</body>

</html>
```

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [January 12, 2021, 5:31pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678/3 "2021-01-12T17:31:24Z")

</div>

see [Problem With Align-Items](http://forum.kirupa.com/t/problem-with-align-items/645588) 😉

---

<div class="post-metadata">

### Author: ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)
#### Post date: [January 12, 2021, 5:43pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678/4 "2021-01-12T17:43:56Z")

</div>

I am going to pass out from embarrassment! Talk about covering the same ground twice! There’s such forest of properties and values in html that even when I think I know the expression of the value for some property - it turns out that I don’t. In this case it’s even worse since I had gone over this very ground before. There should be a bible of html with all the properties and their possible values. Really - can anyone remember all of it?

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [January 12, 2021, 7:00pm UTC](https://forum.kirupa.com/t/justify-content-issues/645678/5 "2021-01-12T19:00:20Z")

</div>

MDN is a good resource. It has the names of the different possible values for all the different CSS properties.

> **[justify-content - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)**
>
> The CSS justify-content property defines how the browser distributes space between and around content items along the main axis of a flex container and the inline axis of grid and multicol containers.

Also, and I may have mentioned this before, it can help to look at the developer console/inspect your elements and see if there are any problems with the CSS. If the property value is bad, it will show a warning.

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/2X/0/0914595913851c3b0a78076651d564f7d11fbcf4.png)

---

<div class="post-metadata">

### Author: ![ariful](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@ariful](https://forum.kirupa.com/u/ariful)
#### Post date: [February 23, 2021, 4:54am UTC](https://forum.kirupa.com/t/justify-content-issues/645678/6 "2021-02-23T04:54:36Z")

</div>

> [@John\_Stern](#):
>
> ```auto
> .container {
> width: 600px;
> height: 800px;
> border: 4px solid black;
> display: flex;
> justify-content: flex-center;
> text-align: center;
> }
> 
> ```

You can use - **justify-content: center;** not use justify-content: flex-center;

 ![Capture](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/2X/9/9d9dbb759e454ad3fa4f4ac87784df2718e32e0f.png)
