tailwindcss学习03

news/2025/2/22 11:10:33

01 入门
02 vue中接入
03 工具类优先

准备

vue.svg

<svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a">
<stop stop-color="#2397B3" offset="0%"></stop><stop stop-color="#13577E" offset="100%"></stop>
</linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b">
<stop stop-color="#73DFF2" offset="0%"></stop>
<stop stop-color="#47B1EB" offset="100%"></stop></linearGradient></defs>
<g fill="none" fill-rule="evenodd"><path d="M28.872 22.096c.084.622.128 1.258.128 1.904 0 7.732-6.268 14-14 14-2.176 0-4.236-.496-6.073-1.382l-6.022 2.007c-1.564.521-3.051-.966-2.53-2.53l2.007-6.022A13.944 13.944 0 0 1 1 24c0-7.331 5.635-13.346 12.81-13.95A9.967 9.967 0 0 0 13 14c0 5.523 4.477 10 10 10a9.955 9.955 0 0 0 5.872-1.904z" fill="url(#a)" transform="translate(1 1)"></path><path d="M35.618 20.073l2.007 6.022c.521 1.564-.966 3.051-2.53 2.53l-6.022-2.007A13.944 13.944 0 0 1 23 28c-7.732 0-14-6.268-14-14S15.268 0 23 0s14 6.268 14 14c0 2.176-.496 4.236-1.382 6.073z" fill="url(#b)" transform="translate(1 1)"></path><path d="M18 17a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM24 17a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM30 17a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" fill="#FFF"></path></g>
</svg>

传统方式构建聊天组件

<script setup>
</script>

<template>
  <div class="chat-notification">
  <div class="chat-notification-logo-wrapper">
    <img class="chat-notification-logo" src="./assets/vue.svg" alt="ChitChat Logo">
  </div>
  <div class="chat-notification-content">
    <h4 class="chat-notification-title">ChitChat</h4>
    <p class="chat-notification-message">You have a new message!</p>
  </div>
</div>
</template>

<style scoped>
 .chat-notification {
    display: flex;
    align-items: center;
    max-width: 24rem;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }
  .chat-notification-logo-wrapper {
    flex-shrink: 0;
  }
  .chat-notification-logo {
    height: 3rem;
    width: 3rem;
  }
  .chat-notification-content {
    margin-left: 1.5rem;
  }
  .chat-notification-title {
    color: #1a202c;
    font-size: 1.25rem;
    line-height: 1.25;
  }
  .chat-notification-message {
    color: #718096;
    font-size: 1rem;
    line-height: 1.5;
  }
</style>

在这里插入图片描述

在这里插入图片描述

tailwindcss_70">tailwindcss

<script setup>
</script>

<template>
<div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-lg flex items-center gap-x-4">
  <div class="shrink-0">
    <img class="size-12" src="./assets/vue.svg" alt="ChitChat Logo">
  </div>
  <div>
    <div class="text-xl font-medium text-black">ChitChat</div>
    <p class="text-slate-500">You have a new message!</p>
  </div>
</div>
</template>

<style scoped>
</style>

带有响应式悬浮效果的个人名片

<script setup>
</script>

<template>
<div class="py-8 px-8 max-w-sm mx-auto space-y-2 bg-white rounded-xl shadow-lg sm:py-4 sm:flex sm:items-center sm:space-y-0 sm:gap-x-6">
  <img class="block mx-auto h-24 rounded-full sm:mx-0 sm:shrink-0" src="./assets/erin-lindford.jpg" alt="Woman's Face" />
  <div class="text-center space-y-2 sm:text-left">
    <div class="space-y-0.5">
      <p class="text-lg text-black font-semibold">
        Erin Lindford
      </p>
      <p class="text-slate-500 font-medium">
        Product Engineer
      </p>
    </div>
    <button class="px-4 py-1 text-sm text-purple-600 font-semibold rounded-full border border-purple-200 
    hover:text-white hover:bg-purple-600 hover:border-transparent 
    focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2">Message</button>
  </div>
</div>
</template>

<style scoped>
</style>

pc端
在这里插入图片描述

手机端
在这里插入图片描述

上面的css类不太了解没关系,后面会挨个学习,主要是了解一下tailwindcss特性

参考

工具类优先


http://www.niftyadmin.cn/n/5862164.html

相关文章

深度学习(2)-深度学习关键网络架构

关键网络架构 深度学习有4种类型的网络架构&#xff1a;密集连接网络、卷积神经网络、循环神经网络和Transformer。每种类型的模型都是针对特定的输入模式&#xff0c;网络架构包含了关于数据结构的假设&#xff0c;即模型搜索的假设空间。某种架构能否解决某个问题&#xff0…

书生大模型实战营12-InternVL 多模态模型部署微调

文章目录 L2——进阶岛InternVL 部署微调实践0.开发机创建与使用1.环境配置1.1.训练环境配置1.2.推理环境配置 2.LMDeploy部署2.1.LMDeploy基本用法介绍2.2.网页应用部署体验2.3 出错解决2.3.1 问题12.3.2 问题2 3.XTuner微调实践3.1.准备基本配置文件3.2.配置文件参数解读3.3.…

Spring MVC 对象转换器:初级开发者入门指南

Spring MVC 对象转换器&#xff1a;初级开发者入门指南 为什么需要对象转换器&#xff1f; 在 Web 应用中&#xff0c;我们经常需要处理不同类型的对象。例如&#xff1a;前端数据到后端对象 &#xff1a;用户通过表单提交的数据通常是HttpServletRequest 对象&#xff0c;我们…

SIM盾构建安全底座的可行性分析

一、背景 1.1安全需求现状 在数字化时代&#xff0c;信息安全面临着日益严峻的挑战。各类网络攻击手段层出不穷&#xff0c;如数据泄露、恶意软件攻击、网络诈骗等&#xff0c;给个人、企业和社会带来了巨大的损失。为了保障信息系统的安全性&#xff0c;需要构建一个可靠的安…

JavaScript系列(80)--WebAssembly 基础入门

WebAssembly 基础入门 &#x1f680; WebAssembly&#xff08;简称Wasm&#xff09;是一种低级的类汇编语言&#xff0c;它具有紧凑的二进制格式&#xff0c;能够以接近原生的性能在现代Web浏览器中运行。让我们深入了解这项革命性的技术。 WebAssembly 概述 &#x1f31f; &…

亚马逊爬虫还有哪些注意事项?

在使用爬虫获取亚马逊商品信息时&#xff0c;除了技术实现外&#xff0c;还需要注意诸多细节&#xff0c;以确保爬虫的稳定运行并避免法律风险。以下是基于最新搜索结果的注意事项总结&#xff1a; 1. 遵守法律法规和亚马逊政策 在爬取亚马逊数据时&#xff0c;必须严格遵守相…

在 Mac ARM 架构的 macOS 系统上启用 F1 键作为 Snipaste 的截屏快捷键

在 Mac ARM 架构的 macOS 系统上启用 F1 键作为 Snipaste 的截屏快捷键&#xff0c;主要涉及到两个方面&#xff1a;确保 F1 键作为标准功能键工作 和 在 Snipaste 中设置 F1 为快捷键。 因为 Mac 默认情况下&#xff0c;F1-F12 键通常用作控制屏幕亮度、音量等系统功能的快捷键…

golang内存泄漏

golang也用了好几年了&#xff0c;趁着有空 整理归纳下&#xff0c;以后忘了好看下 一般认为 Go 10次内存泄漏&#xff0c;8次goroutine泄漏&#xff0c;1次是真正内存泄漏&#xff0c;还有1次是cgo导致的内存泄漏 1:环境 go1.20 win10 2:goroutine泄漏 单个Goroutine占用内存&…