twitter-bootstrap-4

How to center the image in bootstrap 4? [duplicate]

核能气质少年 提交于 2019-11-28 06:55:31
问题 This question already has an answer here: Bootstrap 4 center-block unable to center 3 answers How do I center an image in Bootstrap? 2 answers I am new to Bootstrap 4, earlier in Bootstrap 3 we use class "center-block", now I am not able to find this in new version. 回答1: This can be done with built-in .d-block: <div class="container"> <div class="row"> <div class="col-4"> <img class="mx-auto d-block" src="..."> </div> </div> </div> More info in this link 回答2: Center an inline element has

using bootstrap with vue webapp : How to customise

有些话、适合烂在心里 提交于 2019-11-28 04:47:41
问题 I am using bootstrap-4 in my Vue webapp, But I am not able to customise this as is explained here. I have my index.html which uses Bootstrap CDN, like following: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Sample</title> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> <link rel=

Bootstrap 4 alpha 6 nav-tabs align item right

。_饼干妹妹 提交于 2019-11-28 04:33:45
问题 I am trying to create a tab menu that has nav-item dropdown to the far right of the menu. Bootstrap 4 alpha 5, with float-xs-right its working: http://codeply.com/go/FCFPpRqhZd Bootstrap 4 alpha 6, i changed to float-right but it isnt working: http://codeply.com/go/5mddDUv1M6 Have idea? 回答1: Since alpha 6 is now flexbox, float will no longer work in this case. Use the ml-auto utility class instead for margin-left:auto <div class="col-md-12"> <ul class="nav nav-tabs"> <li class="nav-item"> <a

What is the '.well' equivalent class in Bootstrap 4

假装没事ソ 提交于 2019-11-28 04:26:30
In bootstrap-3 there is .well class which adds a rounded border around an element with a gray background color and some padding. <div class="well">Basic Well</div> But, I didn't find any .well class in bootstrap-4. Is there any tag equivalent to .well in bootstrap-4? Zim Update 2018... card has replaced the well . Bootstrap 4 <div class="card card-body bg-light"> Well </div> or , as two DIVs... <div class="card bg-light"> <div class="card-body"> ... </div> </div> (Note: in Bootstrap 4 Alpha, these were known as card-block instead of card-body and bg-faded instead of bg-light ) http://codeply

How to limit number of columns of card-deck?

点点圈 提交于 2019-11-28 01:58:50
This is my code, what I want to achieve is only four columns in a row, and no more or less than that, but currently, the number of cards range from 1-10, they keep compressing until 10. <div class="card-deck-wrapper"> <div class="card-deck"> @foreach($resource->projects as $project) <div class="card card-project"> bla bla (every card let's say is like this) </div> @endforeach </div> </div> As explained in the docs, Card layouts (decks, groups and columns) ... "For the time being, these layout options are not yet responsive." Therefor, you can't limit the cards per row in the card-deck . You

Column ordering in Bootstrap 4 with push/pull and col-md-12

流过昼夜 提交于 2019-11-27 22:56:36
I've two columns with the class col-md-12 each. In desktop view they should display like: Col **1** Col **2** In the mobile view the should display like this: Col **2** Col **1** Is this even possible with the column ordering of Bootstrap? My current code: <div class="row"> <div class="col-xs-push-12 col-md-12"> Col 1 </div> <div class="col-xs-pull-12 col-md-12"> Col 2 </div> </div> UPDATE (FEB 2018) - v4.0.0 Now that bootstrap has been released, you can achieved that using order utility classes as you were able to do it in beta version (see old update below), with the difference that they've

Centering the navbar content in Bootstrap 4 (alpha 5)

﹥>﹥吖頭↗ 提交于 2019-11-27 16:10:32
I am trying to center the navbar content in Bootstrap 4, alpha 5. I have been googling a bit, and I guess there might be some trick involving d-block and mx-auto . However I cannot find out how to center the navigation links so that they are total in center, not just adding a container around them. Sample navbar code I am playing with:. <nav class="navbar navbar-light bg-faded"> <ul class="nav navbar-nav"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link" href="#">Features</a> </li> <li

Bootstrap 4 responsive navbar vertical

我怕爱的太早我们不能终老 提交于 2019-11-27 15:43:52
I am using Bootstrap 4 and have navigation with horizontal items on my page. On small devices this menu collapses and menu items are still in horizontal line. What should I do to change it to vertical so items are one per each line? For Bootstrap 4, the breakpoints have changed. You should override the navbar CSS like this if you want it to be vertical on small screens: @media(max-width: 544px) { .navbar .navbar-nav>.nav-item { float: none; margin-left: .1rem; } .navbar .navbar-nav { float:none !important; } .navbar .collapse.in, .navbar .collapsing { clear:both; } } Demo http://codeply.com/go

How to use CSS position sticky to keep a sidebar visible with Bootstrap 4

荒凉一梦 提交于 2019-11-27 14:46:10
I have a two columns layout like this: <div class="row"> <div class="col-xs-8 content"> </div> <div class="col-xs-4"> </div> </div> If I set the position:sticky to the sidebar column, I get the sticky behaviour of the sidebar: https://codepen.io/marcanuy/pen/YWYZEp CSS: .sticky { position: sticky; top: 10px; } HTML: <div class="row"> <div class="col-xs-8 content"> </div> <div class="col-xs-4 sticky"> </div> </div> But when I set the sticky property only to the menu that is located in the sidebar, so the related articles section scrolls normally and gets the sticky behaviour with the menu div ,

Bootstrap 4 Multiple fixed-top navbars

半城伤御伤魂 提交于 2019-11-27 13:17:17
Is it possible to have multiple fixed-top navbars in Bootstrap 4 showing under each other? The 1 currently overlays the other which is not what I want. Yes, it's possible but you have to position the 2nd one accordingly. The height of the Navbar is ~56px. .fixed-top-2 { margin-top: 56px; } body { padding-top: 105px; } <nav class="navbar navbar-toggleable-sm bg-faded navbar-light fixed-top fixed-top-2"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbar1"> <span class="navbar-toggler-icon"></span> </button> <a href="/" class="navbar