如何将单个 md-tab 元素向右对齐 [英] How to align a single md-tab element to the right
问题描述
是否可以将单个 md-tab
元素与 md-tabs
的右侧对齐,同时让其余的选项卡保持原样?>
Is it possible to align a single md-tab
element to the right of md-tabs
, while having the rest of the tabs remain where they are?
-------------------------------------------------------------------------
| Tab 1 | Tab 2 | Tab 3 | | Select |
-------------------------------------------------------------------------
我不一定需要选项卡中的 select 元素,但是如果我将 select
放在 md-tabs
之外,它会显示在选项卡下,不是我想要的.
I don't necessarily need the select element in a tab, but if I put the select
outside of the md-tabs
it shows up under the tabs, which isn't what I want.
我知道这看起来是一个简单的问题,但我一直在努力让这个问题奏效.
I know it looks like a simple question, but I've been struggling to make this work for a while now.
代码如下:
推荐答案
您可以简单地在父容器内为 select
使用绝对定位,但这是一个肮脏的解决方案:select 可以重叠选项卡以防万一一行中的许多标签或小屏幕宽度.
You can simply use absolute positioning for select
inside parent container, but this is a dirty solution: select can overlap the tabs in case of many tabs in a row or a small screen width.
请检查这个小提琴,它有效:https://jsfiddle.net/0Lxscboy/1/一个>
Please check this fiddle, it works: https://jsfiddle.net/0Lxscboy/1/
这篇关于如何将单个 md-tab 元素向右对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!