question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to style md-tab?

See original GitHub issue

How do I style the md-tab?

I’ve created a few test tabs using the documentation. But I can’t figure out how to make the tab’s width to be smaller. The default width is too large for mobile screens.

<md-tab-group selectedIndex=0>
  <md-tab style="width:50px">
    <template md-tab-label>Tab1</template>
      <h1>Some more tab content</h1>
      <p>...</p>
    <template md-tab-content>
    </template>
  </md-tab>
  <md-tab>
    <template md-tab-label>Tab2</template>
    <template md-tab-content>
      <h1>Some more tab content</h1>
      <p>...</p>
    </template>
  </md-tab>
</md-tab-group>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
RedFourcommented, Aug 23, 2016

@hstevensagain thx! the css code you gave worked!

/deep/ .md-tab-label {
  min-width: 1px !important;
}
6reactions
hstevensagaincommented, Aug 23, 2016

@jelbourn, @RedFour seems to specifically be talking about this, which doesn’t look slated for theming at the moment. Dynamic changes to the width of the tabs probably aren’t in the scope of app wide theming either.

Imo md-tab-labels shouldn’t have a min-width. They should expand and contract to the width of the md-tab-group, keeping the tabs responsive after that is the developer’s job.

I get that there is a lot more work to be done on md-tabs, for the mean time changing the min-width: 160px; to width: 100%; would make md-tabs a lot more usable and responsive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

W3.CSS Tabs - W3Schools
Tabbed navigation is a way to navigate around a website. Normally, tabbed navigation uses navigation buttons (tabs) arranged together with the selected tab...
Read more >
Styles Tab - Skillsoft Product Documentation
The Styles tab displays the styles for the selected block or page. Styles are based on cascading style sheets (CSS). ... Clicking the...
Read more >
15 CSS Tabs - Free Frontend
Collection of free HTML and pure CSS tabs. ... selector combined with a lot of + 's to style different pages of an...
Read more >
Tab Styles Inspiration - Codrops
Tab Styles Inspiration: A small collection of styles for tabs. ... Technique from Slanted tabs with CSS 3D transforms by Lea Verou.
Read more >
Using the Styles Tab - PTC Support
On the Styles tab, you can modify two types of style theme settings: Global and Elements. By default, style settings cascade from Global...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found