最适合网络开发者的网站
W3CSS。初学者课程

尿素

W3.CSS Tags (Labels and Signs)


Tags: Done New! More Later!

Tags as signs: Falcon Ridge Parkway STOP! WATCH OUT!


W3.CSS Tag Classes

W3.CSS provides one class for tags, labels, and signs:

班级 定义
w3-tag Rectangular black tag/label

Tags, Labels, and Signs

In the W3.CSS world there is no real difference between a tag, a label, or a sign.


Tags are Rectangular

w3-tag class creates a rectangular tag (label or sign). The default color is black:

Status: Done

例子

<p>Status: <span class="w3-tag">Done</span></p>
亲自尝试 »

Colored Tags

Use a w3-color class to change the color of a tag:

New!

More Later!

例子

<p><span class="w3-tag w3-blue">New!</span></p>
<p><span class="w3-tag w3-teal">More Later!</span></p>
亲自尝试 »

Tag Sizes

By default, a tag will inherit the size of its container.

w3-尺寸 classes (w3-tiny, w3-small, w3-large, w3-xlarge, w3-xxlarge, w3-xxxlarge, w3-jumbo) can be used to modify the size of a tag:

6 6 6

66 66 66

66 66

You might want to add some extra padding to large tags:

例子

<span class="w3-tag w3-jumbo w3-blue">66</span>
<span class="w3-tag w3-jumbo w3-blue w3-padding-large">66</span>
亲自尝试 »

Letter Tags

A U G U S T

例子

<span class="w3-tag w3-xlarge">A</span>
<span class="w3-tag w3-xlarge">U</span>
<span class="w3-tag w3-xlarge">G</span>
<span class="w3-tag w3-xlarge">U</span>
<span class="w3-tag w3-xlarge">S</span>
<span class="w3-tag w3-xlarge">T</span>
亲自尝试 »
S A L E

例子

<span class="w3-tag w3-jumbo w3-red">S</span>
<span class="w3-tag w3-jumbo">A</span>
<span class="w3-tag w3-jumbo w3-yellow">L</span>
<span class="w3-tag w3-jumbo">E</span>
亲自尝试 »

Signs

Signs are nothing but large tags.

London Zoo

例子

<div class="w3-tag w3-xxlarge w3-orange">London Zoo</div>
亲自尝试 »

Road Signs

Falcon Ridge Parkway

例子

<div class="w3-tag w3-round w3-green" style="padding:3px">
  <div class="w3-tag w3-round w3-green w3-border w3-border-white">
    Falcon Ridge Parkway
  </div>
</div>
亲自尝试 »

Large Signs

w3-尺寸 classes can be used to display large signs:

IN CASE OF
EMERGENCY:
RUN LIKE HELL!

例子

<span class="w3-tag w3-xxlarge w3-padding w3-orange w3-center">
<strong>
IN CASE OF<br>
EMERGENCY:<br>
RUN LIKE HELL!
</strong>
</span>
亲自尝试 »
49,99

例子

<span class="w3-tag w3-jumbo w3-green">
49<span class="w3-xlarge">,99</span>
</span>
亲自尝试 »

Rounded Signs

w3-回合-尺寸 classes can be used to add rounded corners to a sign:

DO NOT
REATHE
UNDER WATER

例子

<span class="w3-tag w3-padding w3-round-large w3-red w3-center">
DO NOT<br>
BREATHE<br>
UNDER WATER
</span>
亲自尝试 »

Rotating Tags

Use the standard CSS transform property to rotate a sign:

STOP

例子

<span class="w3-tag w3-xlarge w3-padding w3-red" style="transform:rotate(-5deg)">
STOP
</span>
亲自尝试 »

Note: transform:rotate() does not work in IE 9 and earlier.


Spinning Tags

w3-spin class can be used to let a sign spin 360 degrees:

STOP

例子

<span class="w3-tag w3-spin w3-large">
STOP
</span>
亲自尝试 »