Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 4 - container class and rounded corners?

Tags:

bootstrap-4

How can I have achieve a div which has a container class from Bootstrap but also has rounded corners?

<div class="container rounded">
  <div class="row">
     <div class="col">Approver:</div>
  </div>
</div>

When I use the above code, my corners still appear to be square however Bootstrap 4 documentation states that the "rounded" class should take care of rounded corners?

like image 636
Sid Avatar asked May 14 '18 22:05

Sid


People also ask

Which bootstrap 4 class is used to add rounded corners to an image?

img-rounded − You can make rounded corners to an image by using . rounded class.

How do I make rounded corners in bootstrap?

<div class="img-rounded"> will give you rounded corners.

Which bootstrap 4 class can be used to make a borderless table?

Add .table-borderless for a table without borders.


1 Answers

As per the documentation, The rounded class in bootstrap does the following:

.rounded {
    border-radius:.25rem!important
}

You should be able to use it on a container.

However, keep in mind that unless the background color is of a different color than the container (or unless it has a differently colored border), it won't be visible.

Here's a snippet:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container rounded">
  This rounded container has no background color.
</div>

<hr />

<div class="container rounded bg-dark">
  This rounded container has a background color.
</div>

<hr />

<div class="container rounded" style="border:1px solid black">
  This rounded container has no background color, but it has a black border.
</div>
like image 57
TwiN Avatar answered Jan 03 '23 12:01

TwiN