Add top rounded corners to an element in Bootstrap 4

BootstrapWeb DevelopmentCSS Framework

To add top rounded corners to an element, use the rounded-top class in Bootstrap 4.

I have taken div as the element −

<div class="new rounded-top"></div>

Let us learn how to add top rounded corners to an element −

Example

Live Demo

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <style>
    .new {
      width: 80px;
      height: 80px;
      background-color: #EE6D1E;
      margin: 20px;
    }
    </style>
  </head>
<body>
  <div class="container">
    <h2>Rounded Corner</h2>
    <p>We have a rectangle with top rounded corner:</p>
    <div class="new rounded-top"></div>
  </div>

</body>
</html>
raja
Published on 20-Jul-2018 10:12:15
Advertisements