How to make a full-width tab card in bootstrap-vue?
up vote
1
down vote
favorite
I'm having some thing like this from the Docs in bootstrap-vue
:
Card with tabs:
So how do I manage to design the tabs like this:
My current code:
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active>
Tab Contents 1
</b-tab>
<b-tab title="Tab 2">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
javascript css vue.js frameworks bootstrap-vue
add a comment |
up vote
1
down vote
favorite
I'm having some thing like this from the Docs in bootstrap-vue
:
Card with tabs:
So how do I manage to design the tabs like this:
My current code:
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active>
Tab Contents 1
</b-tab>
<b-tab title="Tab 2">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
javascript css vue.js frameworks bootstrap-vue
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm having some thing like this from the Docs in bootstrap-vue
:
Card with tabs:
So how do I manage to design the tabs like this:
My current code:
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active>
Tab Contents 1
</b-tab>
<b-tab title="Tab 2">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
javascript css vue.js frameworks bootstrap-vue
I'm having some thing like this from the Docs in bootstrap-vue
:
Card with tabs:
So how do I manage to design the tabs like this:
My current code:
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active>
Tab Contents 1
</b-tab>
<b-tab title="Tab 2">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
javascript css vue.js frameworks bootstrap-vue
javascript css vue.js frameworks bootstrap-vue
edited Nov 9 at 0:01
asked Nov 8 at 22:22
quanpham0805
349
349
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07
add a comment |
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You could add the following simple CSS rules and add full-width
class to b-card
:
<b-card no-body class="full-width" >
...
.full-width .card-header-tabs {
margin-right: -21px;
margin-left: -21px;
}
.full-width .nav-tabs .nav-item {
margin-bottom: -1px;
flex-grow: 1;
text-align: center;
}
and everything will be done
check this codesandbox code
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
|
show 6 more comments
up vote
2
down vote
You can use title-item-class="w-50"
to make each tap title occupies 50% width
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active title-item-class="w-50">
Tab Contents 1
</b-tab>
<b-tab title="Tab 2" title-item-class="w-50">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You could add the following simple CSS rules and add full-width
class to b-card
:
<b-card no-body class="full-width" >
...
.full-width .card-header-tabs {
margin-right: -21px;
margin-left: -21px;
}
.full-width .nav-tabs .nav-item {
margin-bottom: -1px;
flex-grow: 1;
text-align: center;
}
and everything will be done
check this codesandbox code
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
|
show 6 more comments
up vote
1
down vote
accepted
You could add the following simple CSS rules and add full-width
class to b-card
:
<b-card no-body class="full-width" >
...
.full-width .card-header-tabs {
margin-right: -21px;
margin-left: -21px;
}
.full-width .nav-tabs .nav-item {
margin-bottom: -1px;
flex-grow: 1;
text-align: center;
}
and everything will be done
check this codesandbox code
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
|
show 6 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You could add the following simple CSS rules and add full-width
class to b-card
:
<b-card no-body class="full-width" >
...
.full-width .card-header-tabs {
margin-right: -21px;
margin-left: -21px;
}
.full-width .nav-tabs .nav-item {
margin-bottom: -1px;
flex-grow: 1;
text-align: center;
}
and everything will be done
check this codesandbox code
You could add the following simple CSS rules and add full-width
class to b-card
:
<b-card no-body class="full-width" >
...
.full-width .card-header-tabs {
margin-right: -21px;
margin-left: -21px;
}
.full-width .nav-tabs .nav-item {
margin-bottom: -1px;
flex-grow: 1;
text-align: center;
}
and everything will be done
check this codesandbox code
edited Nov 9 at 14:21
answered Nov 8 at 22:40
Boussadjra Brahim
4,2003628
4,2003628
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
|
show 6 more comments
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
I've tried your solution and this is what I got: Result It's cool but it only work with <style> tag instead of <style scoped> tag, which is a little bit hard to understand why. Moreover, is there any way that I could shrink the tabs on top of the card?
– quanpham0805
Nov 8 at 23:25
1
1
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
i'm trying to find a way to make that unique
– Boussadjra Brahim
Nov 9 at 0:01
2
2
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
Add a class to your b-card like class="big-card", then prefix your CSS with that class. Like: .big-card .card-header-tabs { ... }. Then the CSS will only apply to card-header-tabs within big-cards
– nardnob
Nov 9 at 14:04
1
1
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
@nardnob thanks a lot, i dit that
– Boussadjra Brahim
Nov 9 at 14:22
2
2
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
@quanpham0805 i updated my answer with nardnob's suggestion
– Boussadjra Brahim
Nov 9 at 14:25
|
show 6 more comments
up vote
2
down vote
You can use title-item-class="w-50"
to make each tap title occupies 50% width
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active title-item-class="w-50">
Tab Contents 1
</b-tab>
<b-tab title="Tab 2" title-item-class="w-50">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
add a comment |
up vote
2
down vote
You can use title-item-class="w-50"
to make each tap title occupies 50% width
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active title-item-class="w-50">
Tab Contents 1
</b-tab>
<b-tab title="Tab 2" title-item-class="w-50">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
add a comment |
up vote
2
down vote
up vote
2
down vote
You can use title-item-class="w-50"
to make each tap title occupies 50% width
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active title-item-class="w-50">
Tab Contents 1
</b-tab>
<b-tab title="Tab 2" title-item-class="w-50">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
You can use title-item-class="w-50"
to make each tap title occupies 50% width
<b-card no-body>
<b-tabs card>
<b-tab title="Tab 1" active title-item-class="w-50">
Tab Contents 1
</b-tab>
<b-tab title="Tab 2" title-item-class="w-50">
Tab Contents 2
</b-tab>
</b-tabs>
</b-card>
answered Nov 8 at 22:38
ittus
5,5271723
5,5271723
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
add a comment |
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
It turns out like this: Result Is there any way that I could shrink the tabs on top of the card? Which means that the tabs take full size of the card header?
– quanpham0805
Nov 8 at 22:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217049%2fhow-to-make-a-full-width-tab-card-in-bootstrap-vue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you try my answer?
– Boussadjra Brahim
Nov 8 at 23:07