Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Way to Use Borders Bootstrap 3

I am just having fun building my own stuff with bootstrap. I am wondering what is the best way to add a border to a container with Bootstrap 3? I am having a hard time finding built in functionality in bootstrap and I am wondering what the best way to do it is for the code below if I want the text to be enclosed in a border.

<div class="container-fluid">
    <div class="row">
      <div class="col-md-12"><p class="text-center">Welcome.</p></div>
    </div>
</div>
like image 470
Dave Avatar asked Dec 19 '17 02:12

Dave


1 Answers

Well you could add the below to your css

 .container-border{
 border: 1px solid #ccc;
 border-radius: 15px;  
 }

<div class="container-fluid container-border">
<div class="row">
  <div class="col-md-12"><p class="text-center">Welcome.</p></div>
</div>

And this would create a border around the text as desired.

Alternatively you could use .panel in Bootstrap (assuming you are using 3.x)

 <div class="panel panel-default">
  <div class="panel-body">
    <p class="text-center">Welcome.</p>
  </div>
 </div

https://jsfiddle.net/3wcvf8t4/4/

like image 189
hylian Avatar answered Nov 17 '22 23:11

hylian