How to limit the width of a DIV

The div with class main should take only 30% in the left side of my page but it takes the full width instead. I tried to specify width but it's not working.

<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
      <div class="main">
          <div class="col-md-4">
              <div class="content-section">
                <h3>Latest Covid Info</h3>
                <p class='text-muted'>You can put any information here you'd like.
                  <ul class="list-group">
                    <div>
                      <li class="list-group-item list-group-item-light">Total Cases</li>
                      <li class="list-group-item list-group-item-light">Total Deaths</li>
                    </div>
                    <hr>
                    <div>
                      <li class="list-group-item list-group-item-light">Total Population</li>
                      <li class="list-group-item list-group-item-light">Vaccinated People Count</li>
                    </div>
                    <hr>
                    <div>
                      <li class="list-group-item list-group-item-light">Announcements</li>
                      <li class="list-group-item list-group-item-light">Calendars</li>
                      <li class="list-group-item list-group-item-light">etc</li>
                    </div>
                  </ul>
                </p>
              </div>
            </div>
          </div>
      </div>
    
    </body>
    </html>



Read more here: https://stackoverflow.com/questions/67378342/how-to-limit-the-width-of-a-div

Content Attribution

This content was originally published by Vishal Patil at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: