I currently have a responsive page that in desktop mode contains 2 columns with text that is centered and aligned. So far, so good. But when I reduce the resolution and switch to mobile mode, I want to get a single column with text that remains centered and aligned, but that's not the case.
Here's what I get in mobile mode :
+------------------------+
| text |
| short text |
| long text |
| another text |
| another short text |
| another long text |
+------------------------+
The expected behavior would be an alignment of texts between the 2 columns like this :
+---------------------------+
| text |
| short text |
| long text |
| another text |
| another short text |
| another long text |
+---------------------------+
Here's a code snippet to help you understand better.
<html lang="en">
<head>
<title>Bootstrap 5 Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<link href="test.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-6 d-flex justify-content-center">
<div>
text<br/>
short text<br/>
long text<br/>
</div>
</div>
<div class="col-lg-6 d-flex justify-content-center">
<div>
another text<br/>
another short text<br/>
another long text<br/>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Maybe I'm going about this the wrong way, but I've looked and I haven't found a solution. But I'm still hopeful and I hope you can help me. Thanks in advance to all for your help.
If I copy>paste your code with bootstrap css 3.3.7 the alignment seems to work? I assume you want the text to be aligned on the left.