tailwind css

介绍 (Introduction)

Developers use Cascading Style Sheets (CSS) to style websites. But often, when building large websites or apps, it becomes tedious to write these rules from scratch. This is why there are multiple CSS frameworks to help make writing CSS easy, such as Bootstrap, Foundation, Bulma, Pure, Materialize, etc.

开发人员使用级联样式表(CSS)对网站进行样式设置。 但是通常,在构建大型网站或应用程序时,从头开始编写这些规则变得很繁琐。 这就是为什么存在多个CSS框架来帮助简化CSS编写的原因,例如Bootstrap , Foundation , Bulma , Pure , Materialize等。

Tailwind CSS is a framework that is somewhat different from the ones previously mentioned, because it doesn’t have a default theme, and there are no built-in UI components. Tailwind is a utility-first CSS framework for rapidly building custom user interfaces. This means that if you’re looking for a framework with a menu of predesigned widgets to build your site with, Tailwind might not be the right framework for you. Instead, Tailwind provides highly composable, low-level utility classes that make it easier to build complex user interfaces without encouraging any two sites to look the same.

Tailwind CSS是一个与前面提到的框架略有不同的框架,因为它没有默认主题,并且没有内置的UI组件。 Tailwind是实用程序优先CSS框架,用于快速构建自定义用户界面。 这意味着,如果您正在寻找带有预先设计的小部件菜单的框架来构建站点,那么Tailwind可能不是您合适的框架。 取而代之的是,Tailwind提供了高度可组合的低级实用程序类,这些类使构建复杂的用户界面更加容易,而无需鼓励任何两个站点看起来都相同。

In this tutorial, you’ll build a landing page to showcase a smart health monitoring wristwatch (SHMW) product to customers.

在本教程中,您将构建一个登录页面,以向客户展示智能健康监控手表(SHMW)产品。

The final product will look like the following:

最终产品将如下所示:

The landing page will be divided into the following:

登陆页面将分为以下几部分:

  • Navbar导航栏
  • Hero section英雄节
  • Features section功能部分
  • Testimonials感言
  • Call to action呼吁采取行动
  • Footer页脚

You can download the assets for this project at this GitHub page.

您可以在此GitHub页面上下载该项目的资产 。

先决条件 (Prerequisites)

A basic understanding of CSS may be helpful, but is not required.

对CSS的基本了解可能会有所帮助,但不是必需的。

第1步-设置项目 (Step 1 — Setting up the Project)

We’ll start by creating a new project directory, which we’ll call shmw and create an index.html file inside it.

我们将从创建一个新的项目目录开始,我们将其称为shmw并在其中创建一个index.html文件。

  • mkdir shmw

    mkdir shmw

  • cd shmw

    cd shmw

  • nano index.html 纳米index.html

To get up and running quickly with Tailwind CSS, we’ll grab the latest default configuration build via CDN (Content Delivery Network). Add the following snippet to index.html:

为了使用Tailwind CSS快速启动并运行,我们将通过CDN(内容交付网络)获取最新的默认配置。 将以下代码段添加到index.html

index.html
index.html
<!DOCTYPE html><html lang="en"><head><title>Smart Health Monitoring Wristwatch</title><link rel="stylesheet" href="https://unpkg.com/tailwindcss/dist/tailwind.min.css" /><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700" rel="stylesheet" /><meta name="viewport" content="width=device-width, initial-scale=1"></head><body class="text-gray-700 bg-white" style="font-family: 'Source Sans Pro', sans-serif"></body></html>

In this snippet, you gave the body a white background and pulled the Source Sans Pro font from Google Fonts.

在此代码段中,您为正文提供了白色背景,并从Google字体中提取了Source Sans Pro字体。

Note: Many of the features of Tailwind CSS are not available using the CDN builds. To take full advantage of Tailwind CSS features, install Tailwind via npm.

注意:使用CDN构建时,Tailwind CSS的许多功能不可用。 要充分利用Tailwind CSS功能,请通过npm安装Tailwind。

第2步-构建导航栏 (Step 2 — Building the Navbar)

The navbar will be divided into two columns. The first column will hold the logo and the second column will hold the navigation links. Add the following code immediately after <body> in the index.html file:

导航栏将分为两列。 第一列将包含徽标,第二列将包含导航链接。 在index.html文件中的<body>之后立即添加以下代码:

index.html
index.html
<nav><div class="container mx-auto px-6 py-2 flex justify-between items-center"><a class="font-bold text-2xl lg:text-4xl" href="#">SHMW</a><div class="block lg:hidden"><button class="flex items-center px-3 py-2 border rounded text-gray-500 border-gray-600 hover:text-gray-800 hover:border-teal-500 appearance-none focus:outline-none"><svg class="fill-current h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" /></svg></button></div><div class="hidden lg:block"><ul class="inline-flex"><li><a class="px-4 font-bold" href="/">Home</a></li><li><a class="px-4 hover:text-gray-800" href="#">About</a></li><li><a class="px-4 hover:text-gray-800" href="#">Contact</a></li></ul></div></div></nav>

Adding .container sets the max-width of an element to match the min-width of the current breakpoint. To make the container centered, you add .mx-auto and .px-6 to have padding on both sides (left and right). Since we want a horizontal navbar, we set the container display to flex and specify how its items should be displayed. Each item should have an equal amount of space between them (using .justify-between), which will push both columns to the edge. They will be vertically centered (using .items-center). Lastly, we add padding to both the top and bottom of the container using .py-2.

添加.container设置元素的max-width以匹配当前断点的min-width 。 若要使容器居中,请添加.mx-auto.px-6以在两侧(左侧和右侧)都具有填充。 由于我们需要水平导航栏,因此我们将容器显示设置为flex并指定应如何显示其项目。 每个项目之间都应有相等的空间(使用.justify-between ),这会将两列都推到边缘。 它们将垂直居中(使用.items-center )。 最后,我们使用.py-2将填充添加到容器的顶部和底部。

The first column holds our business logo (in this case, just text) on the navbar. For the second column, we want the links to be displayed differently on mobile and desktop. We have a div containing a button for our mobile menu, which will only be visible on small screen devices. To achieve this, we add both .block and .lg:hidden, which will make the button visible on mobile devices and hidden on large screens.

第一列在导航栏上包含我们的公司徽标(在本例中为文本)。 对于第二列,我们希望链接在移动设备和台式机上的显示方式有所不同。 我们有一个div其中包含用于移动菜单的按钮,该按钮仅在小屏幕设备上可见。 为此,我们同时添加了.block.lg:hidden ,这将使按钮在移动设备上可见,而在大屏幕上隐藏。

Note: By default, Tailwind CSS takes a mobile-first approach, so we build it from a small screen to a larger screen.

注意:默认情况下,Tailwind CSS采用移动优先方式,因此我们将其从小屏幕扩展到大屏幕。

Next, for the desktop links, we add .hidden and .lg:block, which we do the direct inverse of the above. For the actual links, we add .inline-flex to make the links appear horizontal. For individual links, we give them padding on both sides. To indicate the active link (in our case, the home link), we make the text bold. For the rest of the links, we use a darker shade of gray once the links are hovered over.

接下来,对于桌面链接,我们添加.hidden.lg:block ,这是我们做上述的直接逆。 对于实际的链接,我们添加.inline-flex以使链接显示为水平。 对于单独的链接,我们在它们的两侧都添加了填充。 为了指示活动链接(在本例中为首页链接),我们将文本加粗。 对于其余的链接,将鼠标悬停在链接上时,我们会使用较深的灰色阴影。

第3步-建立英雄区 (Step 3 — Building the Hero Section)

The Hero section will display information about our smart health monitoring wristwatch and a call to action button for the users to take immediate action. Add this code snippet immediately after the navbar:

“英雄”部分将显示有关我们的智能健康监控手表的信息以及号召性用语按钮,以使用户立即采取行动。 在导航栏后立即添加以下代码段:

index.html
index.html
<div class="py-20" style="background: linear-gradient(90deg, #667eea 0%, #764ba2 100%)"><div class="container mx-auto px-6"><h2 class="text-4xl font-bold mb-2 text-white">Smart Health Monitoring Wristwatch!</h2><h3 class="text-2xl mb-8 text-gray-200">Monitor your health vitals smartly anywhere you go.</h3><button class="bg-white font-bold rounded-full py-4 px-8 shadow-lg uppercase tracking-wider">Pre Order</button></div></div>

We start by adding padding to both the top and bottom, and then we set a background gradient. For the call to action button, we give it a white background color, make the text bold, give it some padding, and make it pill-shaped by giving it fully rounded borders. Lastly, we give it some shadow and make the text uppercase.

我们首先在顶部和底部添加填充,然后设置背景渐变。 对于号召性用语按钮,我们给它提供白色背景色,使文本加粗,给其添加一些填充,并通过给其完全圆形的边框使其呈药丸状。 最后,我们给它一些阴影并使文本大写。

Now that you’ve made the hero section, you’re ready to build the features section.

现在,您已经完成了英雄部分,您可以准备构建功能部分。

步骤4 —构建功能部件部分 (Step 4 — Building the Features Section)

In this step, you will build a section that will list out the notable features of the device.

在此步骤中,您将构建一个部分,列出该设备的显着功能。

Add the following immediately after the hero section:

在英雄部分之后立即添加以下内容:

index.html
index.html
<section class="container mx-auto px-6 p-10"><h2 class="text-4xl font-bold text-center text-gray-800 mb-8">Features</h2><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><h4 class="text-3xl text-gray-800 font-bold mb-3">Exercise Metric</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch is able to capture you vitals while you exercise. You can create different category of exercises and can track your vitals on the go.</p></div><div class="w-full md:w-1/2"><img src="assets/health.svg" alt="Monitoring" /></div></div><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><img src="assets/report.svg" alt="Reporting" /></div><div class="w-full md:w-1/2 pl-10"><h4 class="text-3xl text-gray-800 font-bold mb-3">Reporting</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch can generate a comprehensive report on your vitals depending on your settings either daily, weekly, monthly, quarterly or yearly.</p></div></div><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><h4 class="text-3xl text-gray-800 font-bold mb-3">Syncing</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch allows you to sync data across all your mobile devices whether iOS, Android or Windows OS and also to your laptop whether MacOS, GNU/Linux or Windows OS.</p></div><div class="w-full md:w-1/2"><img src="assets/sync.svg" alt="Syncing" /></div></div></section>

The features themselves are displayed in a grid of two columns: the feature text and the accompanying image. On mobile devices, we stack on top of one another. We use flexbox to build our grid.

要素本身显示在两列的网格中:要素文本和随附的图像。 在移动设备上,我们彼此堆叠。 我们使用flexbox构建网格。

第5步-建立推荐部分 (Step 5 — Building the Testimonials Section)

In this step, you will build the testimonial section that will contain cards of some of the testimonies. The card will contain the user’s testimony and the user’s name.

在此步骤中,您将构建“见证”部分,其中将包含一些见证卡。 该卡将包含用户的证词和用户名。

Add the following immediately after the features section:

在功能部分之后立即添加以下内容:

index.html
index.html
<section class="bg-gray-100"><div class="container mx-auto px-6 py-20"><h2 class="text-4xl font-bold text-center text-gray-800 mb-8">Testimonials</h2><div class="flex flex-wrap"><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">Monitoring and tracking my health vitals anywhere I go and on any platform I use has never been easier.</p><p class="text-gray-500 text-xs md:text-sm px-6">John Doe</p></div></div><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">As an Athlete, this is the perfect product for me. I wear my Smart Health Monitoring Wristwatch everywhere I go, even in the bathroom since it's waterproof.</p><p class="text-gray-500 text-xs md:text-sm px-6">Jane Doe</p></div></div><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">I don't regret buying this wearble gadget. One of the best gadgets I own!.</p><p class="text-gray-500 text-xs md:text-sm px-6">James Doe</p></div></div></div></div></section>

First, we give the section a background and center it on the page. For the actual testimonies, we make them appear in a grid with flexbox. We want them to stack (that is, take the full width of the screen) on one another when viewed on mobile devices, hence .w-full. Then, on larger screens, we want them to be displayed in three columns using .md:w-1/3. For the individual cards, we give white background, rounded borders, and shadow.

首先,我们为该部分提供背景,并将其放在页面的中心。 对于实际的见证,我们使它们出现在带有Flexbox的网格中。 在移动设备上查看时,我们希望它们彼此堆叠(即占据屏幕的整个宽度),因此为.w-full 。 然后,在较大的屏幕上,我们希望使用.md:w-1/3将它们显示在三列中。 对于单个卡片,我们给出白色背景,圆角边框和阴影。

第6步-建立号召性用语 (Step 6 — Building the Call to Action)

The call to action section is needed so our users can take immediate action after reading the features of our product and the testimonials from the demo users. Add the following immediately after the testimonials section:

需要号召性用语部分,以便我们的用户在阅读了演示用户的产品功能和推荐后,可以立即采取措施。 在“推荐”部分之后立即添加以下内容:

index.html
index.html
<section style="background-color: #667eea"><div class="container mx-auto px-6 text-center py-20"><h2 class="mb-6 text-4xl font-bold text-center text-white">Limited in Stock</h2><h3 class="my-4 text-2xl text-white">Get yourself the Smart Health Monitoring Wristwatch!</h3><buttonclass="bg-white font-bold rounded-full mt-6 py-4 px-8 shadow-lg uppercase tracking-wider">Pre Order</button></div></section>

Now that you’ve created the call to action, you’re ready to build the footer.

既然已经创建了号召性用语,那么就可以构建页脚了。

步骤7 —建立页脚 (Step 7 — Building the Footer)

The footer will contain extra links like a blog, privacy policy, social media, etc. Add the following immediately after the call to action section:

页脚将包含其他链接,例如博客,隐私权政策,社交媒体等。在号召性用语部分之后立即添加以下内容:

index.html
index.html
<footer class="bg-gray-100"><div class="container mx-auto px-6 pt-10 pb-6"><div class="flex flex-wrap"><div class="w-full md:w-1/4 text-center md:text-left"><h5 class="uppercase mb-6 font-bold">Links</h5><ul class="mb-4"><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">FAQ</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Help</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Support</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left"><h5 class="uppercase mb-6 font-bold">Legal</h5><ul class="mb-4"><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Terms</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Privacy</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left"><h5 class="uppercase mb-6 font-bold">Social</h5><ul class="mb-4"><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Facebook</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Linkedin</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Twitter</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left"><h5 class="uppercase mb-6 font-bold">Company</h5><ul class="mb-4"><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Official Blog</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">About Us</a></li><li class="mt-2"><a href="#" class="hover:underline text-gray-600 hover:text-orange-500">Contact</a></li></ul></div></div></div></footer>

This code displays a bunch of links in a grid of four columns. Each column will stack on one another, and the text will be centered when viewed on small screens.

此代码在四列网格中显示了一堆链接。 每一列将彼此堆叠,并且在小屏幕上查看时,文本将居中。

With that, you have completed your landing page. The completed index.html file will look as follows:

这样,您就完成了登录页面。 完成的index.html文件将如下所示:

index.html
index.html
<!DOCTYPE html><html lang="en"><head><title>Smart Health Monitoring Wristwatch</title><linkrel="stylesheet"href="https://unpkg.com/tailwindcss@next/dist/tailwind.min.css"/><linkhref="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700"rel="stylesheet"/></head><bodyclass="text-gray-700 bg-white"style="font-family: 'Source Sans Pro', sans-serif"><!--Nav--><nav><divclass="container mx-auto px-6 py-2 flex justify-between items-center"><aclass="font-bold text-2xl lg:text-4xl"href="#">SHMW</a><div class="block lg:hidden"><buttonclass="flex items-center px-3 py-2 border rounded text-gray-500 border-gray-600 hover:text-gray-800 hover:border-teal-500 appearance-none focus:outline-none"><svgclass="fill-current h-3 w-3"viewBox="0 0 20 20"xmlns="http://www.w3.org/2000/svg"><title>Menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" /></svg></button></div><div class="hidden lg:block"><ul class="inline-flex"><li><a class="px-4 font-bold" href="/">Home</a></li><li><a class="px-4 hover:text-gray-800" href="#">About</a></li><li><a class="px-4 hover:text-gray-800" href="#">Contact</a></li></ul></div></div></nav><!--Hero--><divclass="py-20"style="background: linear-gradient(90deg, #667eea 0%, #764ba2 100%)"><div class="container mx-auto px-6"><h2 class="text-4xl font-bold mb-2 text-white">Smart Health Monitoring Wristwatch!</h2><h3 class="text-2xl mb-8 text-gray-200">Monitor your health vitals smartly anywhere you go.</h3><buttonclass="bg-white font-bold rounded-full py-4 px-8 shadow-lg uppercase tracking-wider">Pre Order</button></div></div><!-- Features --><section class="container mx-auto px-6 p-10"><h2 class="text-4xl font-bold text-center text-gray-800 mb-8">Features</h2><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><h4 class="text-3xl text-gray-800 font-bold mb-3">Exercise Metrics</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch is able to capture you vitalswhile you exercise. You can create different category of exercisesand can track your vitals on the go.</p></div><div class="w-full md:w-1/2"><img src="assets/health.svg" alt="Monitoring" /></div></div><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><img src="assets/report.svg" alt="Reporting" /></div><div class="w-full md:w-1/2 pl-10"><h4 class="text-3xl text-gray-800 font-bold mb-3">Reporting</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch can generate a comprehensivereport on your vitals depending on your settings either daily,weekly, monthly, quarterly or yearly.</p></div></div><div class="flex items-center flex-wrap mb-20"><div class="w-full md:w-1/2"><h4 class="text-3xl text-gray-800 font-bold mb-3">Syncing</h4><p class="text-gray-600 mb-8">Our Smart Health Monitoring Wristwatch allows you to sync dataacross all your mobile devices whether iOS, Android or Windows OSand also to your laptop whether MacOS, GNU/Linux or Windows OS.</p></div><div class="w-full md:w-1/2"><img src="assets/sync.svg" alt="Syncing" /></div></div></section><!-- Testimonials --><section class="bg-gray-100"><div class="container mx-auto px-6 py-20"><h2 class="text-4xl font-bold text-center text-gray-800 mb-8">Testimonials</h2><div class="flex flex-wrap"><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">Monitoring and tracking my health vitals anywhere I go and onany platform I use has never been easier.</p><p class="text-gray-500 text-xs md:text-sm px-6">John Doe</p></div></div><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">As an Athlete, this is the perfect product for me. I wear mySmart Health Monitoring Wristwatch everywhere I go, even in thebathroom since it's waterproof.</p><p class="text-gray-500 text-xs md:text-sm px-6">Jane Doe</p></div></div><div class="w-full md:w-1/3 px-2 mb-4"><div class="bg-white rounded shadow py-2"><p class="text-gray-800 text-base px-6 mb-5">I don't regret buying this wearble gadget. One of the bestgadgets I own!.</p><p class="text-gray-500 text-xs md:text-sm px-6">James Doe</p></div></div></div></div></section><!--Call to Action--><section style="background-color: #667eea"><div class="container mx-auto px-6 text-center py-20"><h2 class="mb-6 text-4xl font-bold text-center text-white">Limited in Stock</h2><h3 class="my-4 text-2xl text-white">Get yourself the Smart Health Monitoring Wristwatch!</h3><buttonclass="bg-white font-bold rounded-full mt-6 py-4 px-8 shadow-lg uppercase tracking-wider">Pre Order</button></div></section><!--Footer--><footer class="bg-gray-100"><div class="container mx-auto px-6 pt-10 pb-6"><div class="flex flex-wrap"><div class="w-full md:w-1/4 text-center md:text-left "><h5 class="uppercase mb-6 font-bold">Links</h5><ul class="mb-4"><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">FAQ</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Help</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Support</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left "><h5 class="uppercase mb-6 font-bold">Legal</h5><ul class="mb-4"><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Terms</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Privacy</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left "><h5 class="uppercase mb-6 font-bold">Social</h5><ul class="mb-4"><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Facebook</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Linkedin</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Twitter</a></li></ul></div><div class="w-full md:w-1/4 text-center md:text-left "><h5 class="uppercase mb-6 font-bold">Company</h5><ul class="mb-4"><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Official Blog</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">About Us</a></li><li class="mt-2"><ahref="#"class="hover:underline text-gray-600 hover:text-orange-500">Contact</a></li></ul></div></div></div></footer></body></html>

结论 (Conclusion)

In this tutorial, you built a landing page with Tailwind CSS. In addition to using the classes that Tailwind provides, you also used gradient colors to make the landing page have more depth. To learn more about Tailwind CSS, you can read the documentation on their official website.

在本教程中,您使用Tailwind CSS构建了登录页面。 除了使用Tailwind提供的类之外,您还使用了渐变颜色来使登录页面具有更大的深度。 要了解有关Tailwind CSS的更多信息,您可以阅读其官方网站上的文档 。

翻译自: https://www.digitalocean.com/community/tutorials/build-a-beautiful-landing-page-with-tailwind-css

tailwind css

tailwind css_如何使用Tailwind CSS构建样式化的登陆页面相关推荐

  1. tailwind css_什么是Tailwind CSS,如何将其添加到我的网站或React App中?

    tailwind css CSS is a technology that can be your best or worst friend. While it's incredibly flexib ...

  2. 【CSS】样式化文字

    根据MDN网站学习记录笔记 样式化文字 基本文本和字体样式 字体种类 字体样式.字体粗细 文本转换.文本装饰 文字阴影 文本布局 样式列表 符号样式 项目符号位置 自定义项目符号图片 管理列表计数 样 ...

  3. react内联样式_React样式化的组件:内联样式+ 3种其他CSS样式化方法(带有示例)...

    react内联样式 There's no one right way to style your React components. It all depends on how complex you ...

  4. option样式美化 css,CSS select样式优化

    下拉选择菜单基本的CSS样式不怎么好看,通过一些简单的样式优化,就可以起到美化的作用了. 请选择您所在的城市 请选择您所在的城市 中山市 太原市 广州市 CSS样式 .sel_wrap{ height ...

  5. HTML5 CSS3初学者指南(2) – 样式化第一个网页

    介绍 我们已经使用基本的 HTML 编写了一个网页.但是,写出来的 HTML 代码的网页看起来很平淡,没有吸引力. 如何改善这种很平淡的页面呢? 让我们开始使用网页的基本样式来改善页面效果,我们将会使 ...

  6. (31)Gulp 构建样式文件

    一.Gulp构建样式文件流程图 Gulp构建样式文件和我们之前想要实现的效果和流程差不多,我们通过源代码,这里拿less文件举例,第一步那么我们通过less文件先将文件进行转换,转换成浏览器认识的cs ...

  7. CSS第六天-高级技巧(元素隐藏、精灵图、CSS用户界面样式、margi负值作用、CSS三角形)

    ps 今天这是html和css初级部分的最后一份文章了,下次发的就是HTML5和CSS3的一些基础知识.越学到后面,感觉越有意思.到后面可以自己去尝试做一些比较炫酷的动画了,还是蛮期待的. CSS高级 ...

  8. 【网页制作】CSS尺寸样式属性

    CSS尺寸样式属性作用:给html元素设置高度和宽度. 注意:只有块级元素才可以设置宽度和高度. 属性名称 作用 单位/值 height 设置元素的高度 length:使用px表示高度 auto:自动 ...

  9. 海量数据预处理实战----CSS网页样式

    目录 CSS网页样式--选择器 实验目的 实验原理​​​​​​​ 实验步骤 CSS引入方式和优先级 实验总结 CSS网页样式--常用样式 实验目的 实验原理 1.文本样式 2.文字样式 3.链接样式 ...

最新文章

  1. Hashtable,HashMap,ConcurrentHashMap都是Map的实现类,它们在处理null值的存储上有细微的区别,下列哪些说法是正确的
  2. QIIME 2教程. 30补充资源SupplementaryResources(2020.11)
  3. golang 开发常见坑
  4. 全国计算机等级考试 架构师的设计模式
  5. 《Linux From Scratch》第二部分:准备构建 第五章:构建临时文件系统- 5.2 工具链技术备注...
  6. use SQVI to display table join
  7. 关于HttpUtility.UrlEncode,HttpUtility.UrlDecode,Server.UrlEncode,Server.UrlDecode
  8. 大数据与大量数据处理_我们如何处理和使用如此大量的数据?
  9. docker 安装hadoop
  10. Java回文数的判断与生成
  11. mac如何安装python_手把手教你安装Python开发环境(二)之Mac电脑安装Python解释器...
  12. IT兄弟连 JavaWeb教程 Servlet线程安全问题
  13. An internal error occurred during: Launching ****
  14. 【MMD tools for bleander,Bleander的插件】
  15. 泉州程序员置业小指南
  16. java如何把汉字转换成机内码_java语言如何将汉字转化成五笔
  17. centos7安装后ping不通外网问题解决
  18. 综评计算机相关课题,综评系统中的典型事例/自我介绍/课题,怎么写可以让大学教授眼前一亮?...
  19. 64qam用matlab实现 使用matlab进行64qam调制,如何添加星座图程序?
  20. 最简单的函数,看看就会了

热门文章

  1. vue2+vuecli3+elementUI后台管理系列之sidebar导航的开发(五)
  2. c语言打印a-Z字母的方法
  3. Altium Designer 2023介绍
  4. 完全替代ALTERA EP4CE10, 国产AGM FPGA 的AG10K系列与之pin to pin 兼容
  5. 去除office非正版提示的方法(转)
  6. csdn下载积分兑换网址
  7. 售价200万的FF91都回国了,贾跃亭回国还会远吗
  8. 线性表的练习--学生成绩统计
  9. UE4(虚幻4)基础:蓝图初识--开关门(二) 键盘控制门
  10. 分享一个实现夜间模式的浏览器扩展