Colmar Academy - Need help understanding div side by side

Hey, I need to have two divs both with column layout… But something is wrong here. it all started when I made the first div a width of 50%

HTML

<div class="orientationbar">
                <div class="date">  
                    <img src="resources/assets/images/information-orientation.jpg" alt="Oreintation-date">
                    <div class="datetext"><h2>Orientation date</h2>
                    <p>Tue 10/11 & Wed 1-/12: 8am-3pm</p>
                    <span>Read more</span>
                    </div>
                </div>
                <div class="campuscard">
                    <img src="resources/assets/images/information-campus.jpg">
                    <div class="campustext"><h2>Our Campus</h2>
                        <p>Find out which campus is close by you</p>
                        <span>Read more</span>
                        </div>
                </div>
                <div class="guestcard">
                    <img src="resources/assets/images/information-guest-lecture.jpg">
                    <div class="guesttext">
                        <h2>Our guest gecture</h2>
                        <p>Join a keynote with Oliver Sack about music in medical treatment</p>
                        <span>Read more</span>
                        </div>
                </div>
             </div>

CSS

.orientation {
    display: flex;
    flex-direction: column;
    width: 50%;
    float: left;
    
   }
  .studypic {
    padding: 24px;
    width: fit-content;
   }

   .orientationbar {
    display: flex;
flex-direction: column;
   }
   .date {
    display: flex;
    align-items: center;
   }

   .datetext {
    width: 500px;
        display: flex;
        flex-direction: column;
        padding-left: 20px;
   }

   .campuscard {
    display: flex;
    align-items: center;
   }

   .campustext {
    width: 500px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;

   }

   .guestcard {
    display: flex;
    align-items: center;
   }

   .guesttext {
    padding-left: 20px;
    width: 500px;
    display: flex;
    flex-direction: column;
   }

   .guesttext span {
    text-align: center;
    color: blue;
   }

Padding is very often the culprit when it comes to making our layout fluid and effective. This is because it changes the size of the container. See if you cannot find some other way. such as a margin on an inner container (which may require more structure).

I don’t know Flexbox but my understanding is that it supports inline-block with tolerance for variable viewport width.

Another consideration is the 50% chosen width as it does not account for margins that HTML may give to inline-block. Drop to 49% and see what happens.

hey, sorry for replying late. I’ve been trying so many things. I put the section in a wrapper and made the right section to 40% to see if that would work. And it did, but only when I inspected elements which made the screen. I found a few problems:

  1. When I would minimize the screen, the right section would float around the page
  2. When I made the wrapper position: relative and the right section position:absolute, and looked at the page full screen on my 1440p monitor, the right section would overflow.
    and 3) a new section which is supposed to go under this div, stays on top of the previous section despite the order of elements.

I’ll post my code and pictures again:

HTML

 <div class="wrapper"></div>
            <div class="orientation">
                <div class="studypic">
                    <img src="resources/assets/images/information-main.jpg">
                </div>
                <div class="orientationtext">
                    <h1>
                        It doesn't hurt to keep practicing
                    </h1>
                    <p><em>"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia de"</em></p>
                    
                </div>
                <span>Emanuel Sr, Strategist at Hiring.com</span>
                </div>
                
            
                    <div class="orientationbar">
                        <div class="date">  
                            <img src="resources/assets/images/information-orientation.jpg" alt="Oreintation-date">
                            <div class="datetext"><h2>Orientation date</h2>
                            <p>Tue 10/11 & Wed 1-/12: 8am-3pm</p>
                            <span>Read more</span>
                            </div>
                        </div>
                        <div class="campuscard">
                            <img src="resources/assets/images/information-campus.jpg">
                            <div class="campustext"><h2>Our Campus</h2>
                                <p>Find out which campus is close by you</p>
                                <span>Read more</span>
                                </div>
                        </div>
                        <div class="guestcard">
                            <img src="resources/assets/images/information-guest-lecture.jpg">
                            <div class="guesttext">
                                <h2>Our guest gecture</h2>
                                <p>Join a keynote with Oliver Sack about music in medical treatment</p>
                                <span>Read more</span>
                                </div>
                        </div>
                    </div>
            </div>

                        <!--classes-->     
                        <section class="classes">
                            <h1>Start learning</h1>
                        <div class="card">
        
                        </div>
                        <div class="card">
        
                        </div>
                        <div class="card">
        
                        </div>
                        <div class="card">
        
                        </div>
                        <div class="card">
        
                        </div>
                        <div class="card">
        
                        </div>
        
        
        
                    </div>




</body>
</html>

CSS

.wrapper {
    width: 100%;
    position: relative;
   }
                                                                                
   .orientation {
    
    display: flex;
    flex-direction: column;
   float: left;
    
   }

   .orientationtext {
    width: 60%;
   }

   .orientation h1 {
    padding: 32px 0 24px 24px;
   }

   .orientation p {
    padding-left: 24px;
    width: 80%;
   }
 .orientation span {

    padding: 32px 24px 0px;
 }
  .studypic {
    padding: 32px 24px;
    width: fit-content;
   }

   .orientationbar {
    
    border-left: 3px solid grey;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    display: inline-block;
    float: right;
    position: absolute;

   }

   .date {
    border-bottom: 3px solid grey;
    display: flex;
    align-items: center;
   }

 .date img {
    padding: 16px;
 }

   .datetext {
    width: 500px;
        display: flex;
        flex-direction: column;
        padding-left: 20px;
   }

   .datetext span {
    text-align: left;
    color: blue;
   }

   .campuscard {
    border-left: 3px solid grey;
    display: flex;
    align-items: center;
   }

   .campuscard img {
    padding: 16px;
   }

   .campustext {
    width: 500px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;

   }
   .campustext span {
    text-align: left;
    color: blue;
   }

   .guestcard {
    border-left: 3px solid grey;
    display: flex;
    align-items: center;
    padding-bottom: 30px;
   }

 .guestcard img {
    padding: 16px;

 }
   .guesttext {
    padding-left: 20px;
    width: 500px;
    display: flex;
    flex-direction: column;
   }

   .guesttext p{
    padding: 8px 0 ;
   }

   .guesttext span {
    text-align: left;
    color: blue;
   }

                                       /*Classes */
    .classes {
        display: flex;
    }                                                    
    .classes h1 {
        padding: 32px;
    }

and the page full screen on 1440p monitor

thanks so much

That looks a bit off. The wrapper should by all accounts wrap the entire page content, would it not?