源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <title>Bootstrap5 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container mt-3"> <h2>排版</h2> <p class="text-start">左对齐</p> <p class="text-end">右对齐</p> <p class="text-center">居中对齐文本</p> <p class="text-justify">设定文本对齐,段落中超出屏幕部分文字自动换行</p> <p class="text-nowrap">段落中超出屏幕部分不换行</p> <p><strong>提示:</strong> 重置浏览器窗口大小查看换行效果。</p> </div> </body> </html>
运行结果: