Page 225 - Computer Software Application TP - Volume 1
P. 225
COMPUTER SOFTWARE APPLICATION - CITS
<div class=”container”>
<div class=”row mt-5”>
<div class=”col”>
<h2>Positioning Example</h2>
<p>This is a simple example demonstrating how to use Bootstrap v5 classes for positioning elements.</p>
<div class=”position-relative bg-light p-3 mb-3”>
<div class=”position-absolute top-0 start-0 bg-primary p-2”>
Top Left
</div>
<div class=”position-absolute top-0 end-0 bg-success p-2”>
Top Right
</div>
</div>
<div class=”position-relative”>
<img src=”https://via.placeholder.com/400” alt=”Placeholder Image” class=”img-fluid”>
<div class=”position-absolute top-0 start-50 translate-middle-x bg-info p-2”>
Center Top
</div>
<div class=”position-absolute bottom-0 start-50 translate-middle-x bg-secondary p-2”>
Center Bottom
</div>
</div>
<div class=”position-relative bg-light p-3 mb-3”>
<div class=”position-absolute bottom-0 start-0 bg-warning p-2”>
Bottom Left
</div>
<div class=”position-absolute bottom-0 end-0 bg-danger p-2”>Bottom Right
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap Bundle with Popper -->
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.0alpha1/dist/js/bootstrap.bundle.min.js”></script>
</body>
</html>
3 Save the program as a .html file
4 Open the html file with a web browser
5 Verify the output.
210
CITS : IT & ITES - Computer Software Application - Exercise 49