menu MDUI Documentation
color_lens
view_carousel
JavaScript Plug-in
keyboard_arrow_down
local_mall
Resources
keyboard_arrow_down

Auxiliary class

Margin

This series of tools can be added to elements margin with padding, The default values ​​are all multiples of 8px.

The format of the class name is:.mdui-{Attributes}-{direction}-{size}

Attributes:

  • m - Set up margin
  • p - Set up padding

direction:

  • t - Set up margin-top or padding-top
  • b - Set up margin-bottom or padding-bottom
  • l - Set up margin-left or padding-left
  • r - Set up margin-right or padding-right
  • x - Set up margin-leftmargin-right or padding-leftpadding-right
  • y - Set up margin-topmargin-bottom or padding-toppadding-bottom
  • a - Set up margin or padding

size:

  • 0 - 0px
  • 1 - 8px
  • 2 - 16px
  • 3 - 24px
  • 4 - 32px
  • 5 - 40px
.mdui-m-t-0 {
  margin-top: 0 !important;
}

.mdui-m-l-1 {
  margin-left: 8px !important;
}

.mdui-p-x-2 {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.mdui-p-a-5 {
  padding: 40px !important;
}

Fast float

  • .mdui-float-left Float the element to the left
  • .mdui-float-right Float the element to the right
Example
float left
float right
<div class="mdui-float-left">float left</div>
<div class="mdui-float-right">float right</div>

Horizontally centered

Add a class to any element .mdui-center You can make it horizontally centered.

Example
mdui-center
<div class="mdui-center" style="width: 200px">mdui-center</div>

Vertically centered

Add a class to any element .mdui-valign, You can center the child elements of the element vertically.

Example

This should be vertically aligned

<div class="mdui-valign">
  <p class="mdui-center">This should be vertically aligned</p>
</div>

Horizontal alignment

  • .mdui-text-left Align the text to the left.
  • .mdui-text-center Center the text.
  • .mdui-text-right Align the text to the right.
Example
This should be left aligned
This should be center aligned
This should be right aligned
<div class="mdui-text-left">This should be left aligned</div>
<div class="mdui-text-center">This should be center aligned</div>
<div class="mdui-text-right">This should be right aligned</div>

Text case conversion

  • .mdui-text-lowercase Convert the text to lowercase.
  • .mdui-text-uppercase Convert the text to uppercase.
  • .mdui-text-capitalize Convert the text to capitalize the first letter of a word.
Example

Lowercased text.

Uppercased text.

Capitalized text.

<p class="mdui-text-lowercase">Lowercased text.</p>
<p class="mdui-text-uppercase">Uppercased text.</p>
<p class="mdui-text-capitalize">Capitalized text.</p>

Text is automatically truncated

.mdui-text-truncate When the length of the text exceeds the limit, it can be automatically truncated and replaced with an ellipsis.

Example

This is a very very very very very very very very very very very very long text.

<p class="mdui-text-truncate" style="max-width: 200px;">This is a very very very very very very very very very very very very long text.</p>

Clear float

Add for the parent element .mdui-clearfix Class can clear float

Example
mdui-float-left
mdui-float-right
<div class="mdui-clearfix">
  <div class="mdui-float-left">mdui-float-left</div>
  <div class="mdui-float-right">mdui-float-right</div>
</div>

Hide content

  • .mdui-hidden The class is used to hide elements, which is equivalent to adding styles display: none;, The hidden elements do not occupy page space.
  • .mdui-invisible The class is used to make the element invisible, but still occupy space on the page, which is equivalent to adding styles visibility: hidden;

Responsive tools

These tools use media queries to hide content for different devices. These tools include:

  • .mdui-hidden-*: Hide on the device of the specified width.
  • .mdui-hidden-*-up: Hide on devices with a specified width and above.
  • .mdui-hidden-*-down: Hide on devices with a specified width and below.
Ultra-small screen
<600px
Small screen
>=600px - <1024px
Medium screen
>=1024px - <1440px
big screen
>=1440px - <1920px
Large screen
>=1920px
.mdui-hidden-xs visible visible visible visible
.mdui-hidden-sm visible visible visible visible
.mdui-hidden-md visible visible visible visible
.mdui-hidden-lg visible visible visible visible
.mdui-hidden-xl visible visible visible visible
.mdui-hidden-xs-down visible visible visible visible
.mdui-hidden-sm-down visible visible visible
.mdui-hidden-md-down visible visible
.mdui-hidden-lg-down visible
.mdui-hidden-xl-down
.mdui-hidden-xs-up
.mdui-hidden-sm-up visible
.mdui-hidden-md-up visible visible
.mdui-hidden-lg-up visible visible visible
.mdui-hidden-xl-up visible visible visible visible

Adjust the browser window, or view the following examples on different devices. The dark part means it is visible in the current browser window.

✔ .mdui-hidden-xs
✔ .mdui-hidden-sm
✔ .mdui-hidden-md
✔ .mdui-hidden-lg
✔ .mdui-hidden-xl
✔ mdui-hidden-xs-down
✔ mdui-hidden-sm-down
✔ mdui-hidden-md-down
✔ mdui-hidden-lg-down
✔ mdui-hidden-xl-down
✔ mdui-hidden-xs-up
✔ mdui-hidden-sm-up
✔ mdui-hidden-md-up
✔ mdui-hidden-lg-up
✔ mdui-hidden-xl-up
Set document theme

Theme color

Main color

Accent color