-1

Page width available is 1600 px, I was trying to align the div in right, and with max-width: 1200px. But that is not happening.

.csystem {
  display: flex;
  max-width: 1200px;
  flex-direction: column;
  justify-content: flex-end
}
<div class="csystem">
  <h1>Yes</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</div>
ankitkanojia
  • 3,072
  • 4
  • 22
  • 35
beginner115
  • 157
  • 1
  • 11

2 Answers2

3

You should use align-items not justify-content because you changed the flex-direction to column

.csystem {
  display: flex;
  max-width: 1200px;
  /* margin-left: auto; */ /* If you wnat the div to be on the right */
  flex-direction: column;
  align-items: flex-end;
}
<div class="csystem">
  <h1>Yes</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</div>
Mohamed Abdallah
  • 796
  • 6
  • 20
  • A similar solution not working [here](https://codepen.io/codeispoetry/pen/ExaJxmX) – beginner115 Jan 27 '20 at 04:07
  • it's working but the main container doesn't have the full width, if you want to container `.csystem` to be on the left as well add `margin-left: auto` see in this example https://jsfiddle.net/ – Mohamed Abdallah Jan 27 '20 at 04:16
  • margin is the key. Flex is not useful here simple display block and margin-left can do the needful. – beginner115 Jan 27 '20 at 05:21
-1

Try this:

.csystem{
    float: right;
   max-width: 1200px;
}
Rojen
  • 336
  • 1
  • 2
  • 13