TailwindCSS案例

案例 1

tailwindcss-01.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script>
<link
href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.2/css/all.min.css"
rel="stylesheet"
/>
</head>
<body>
<div class="flex w-[300px] m-3 p-3 border-2 border-black">
<img class="w-20 h-20" src="https://loremflickr.com/320/320/boy" />
<div class="flex flex-col justify-center ml-3">
<p class="text-xl text-blue-600">天鼎-挖掘机-郑休文</p>
<div class="flex">
<h2 class="text-base text-gray-600">挖掘机</h2>
<p class="text-base text-gray-600 ml-2">加藤 HD820</p>
</div>
<div class="flex mt-1">
<i class="fas fa-mobile-alt text-base"></i>
<i class="fas fa-camera text-base ml-4"></i>
<div
class="flex items-center text-xs text-red-600 bg-red-100 ml-4 px-2 rounded-xl"
>
报停
</div>
</div>
</div>
</div>
</body>
</html>

案例 2

tailwindcss-02.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script>
<link
href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.2/css/all.min.css"
rel="stylesheet"
/>
</head>
<body>
<div class="flex flex-col w-[300px] m-3 border-2 border-black">
<div class="flex items-center p-2">
<div
class="flex justify-center text-sm text-green-600 bg-green-100 w-12 rounded"
>
运行
</div>
<div class="flex ml-auto w-12">
<i class="fas fa-mobile-alt text-sm text-green-600"></i>
<p class="text-sm text-green-600 ml-2">93%</p>
</div>
</div>
<div class="flex flex-col p-2 bg-[#5B75F2]">
<div class="flex">
<p class="text-base text-gray-300">项目</p>
<p class="text-base text-slate-100 ml-4">南京市江宁体育馆项目</p>
</div>
<div class="flex">
<p class="text-base text-gray-300">地点</p>
<p class="text-base text-slate-100 ml-4">
南京市江宁区淳化街道格致路1号
</p>
</div>
<div class="flex">
<p class="text-base text-gray-300 ml-2">(2024-04-22 09:30)</p>
</div>
</div>
<div class="flex">
<div class="flex items-center justify-center w-1/2 h-10 bg-gray-100">
<i class="fas fa-sync-alt text-sm text-gray-600"></i>
<p class="text-sm text-gray-600 ml-2">刷新</p>
</div>
<div class="flex items-center justify-center w-1/2 h-10 bg-gray-100">
<i class="fas fa-bars text-sm text-gray-600"></i>
<p class="text-sm text-gray-600 ml-2">导航</p>
</div>
</div>
</div>
</body>
</html>

资源