I’m working on some HTML and CSS code that looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8defe2e2f9fef9ffecfdcdb8a3bca3be">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Document</title>
</head>
<body>
<div class="container p-1">
<div class="row">
<div class="col-6" style="background-color: yellowgreen;">
Hello 1
</div>
<div class="col-6" style="background-color: yellow;">
Hello 2
</div>
</div>
</div>
</body>
</html>
I used to believe that the negative margin in the row would just affect the padding of the columns. But it seems like there’s more to it.
Why do I also need to add extra left/right padding of 12px to the container to prevent horizontal scrolling on mobile devices...
Why is it so restricted to adjust the container padding as desired?