I've just started with Twitter Bootstrap and here is one question.
I am creating custom <header>
block, and I want it's bottom corners to be rounded.
Is there any "correct" way to do this by using predefined classes, or I have to specify it manually like:
border-radius: 10px; // and all that cross-browser trumpery
For now, I'm using css
styles. Maybe it will be better to use less
for that issue?
Bootstrap is just a big, useful, yet simple CSS file - not a framework or anything you can't override. I say this because I've noticed many developers got stick with BS classes and became lazy "I-can't-write-CSS-code-anymore" coders [this not being your case of course!].
If it features something you need, go with Bootstrap classes - if not, go write your additional code in good ol'
style.css
.To have best of both worlds, you may write your own declarations in LESS and recompile the whole thing upon your needs, minimizing server request as a bonus.
Without less, ans simply for a given div :
In a css :
In html :
In Bootstrap 4, the correct way to border your elements is to name them as follows in the class list of your elements:
To use Bootstrap 4 css files, you can simply use the CDN, and use the following link in the of your HTML file:
This will provided you with the basics of Bootstrap 4. However if you would like to use the majority of Bootstrap 4 components, including tooltips, popovers, and dropdowns, then you are best to use the following code instead:
Alternatively, you can install Bootstrap using NPM, or Bower, and link to the files there.
*Note that the bottom tag of the three is the same as the first tag in the first link path.
A full working example, could be :
In the above example, the image is centered by using the Bootstrap auto margin on left and right.
What you want is a Bootstrap panel. Just add the
panel
class, and your header will look uniform. You can also add classespanel panel-info
,panel panel-success
, etc. It works for pretty much any block element, and should work with<header>
, but I expect it would be used mostly with<div>
s.As per bootstrap 3.0 documentation. there is no rounded corners class or id for div tag.
you can use circle behavior for image by using
or just use custom
border-radius
css3 property in cssfor only bottom rounded coner use following
if you want responsive circular div then try this
referred from Responsive CSS Circles
If you're using Bootstrap Sass, here's another way that avoids having to add extra classes to your element markup: