如何在右侧对齐单个md-tab元素 [英] How to align a single md-tab element to the right

查看:90
本文介绍了如何在右侧对齐单个md-tab元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将单个 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.

以下是代码:

codepen

推荐答案

您可以对父容器内的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆