基础输入框

无边框

无边框输入框主要使用了shadow阴影,适合在有底色的环境中使用。

无边框

<input type="text" class="relative outline-none rounded px-2 py-1 w-full bg-white shadow text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" />
样式 属性
relative position:relative;
outline-none outline:0;
px-2 py-1 padding:.25rem .5rem;
w-full width:100%;
bg-white background-color:white;
shadow box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
text-sm text-gray-700 font-size:.875rem; color:#b83280;

placeholder-gray-400实际的类名全程为.placeholder-pink-400::placeholder表示文本占位符的颜色color: #f687b3;

伪类 样式 属性
focus outline-none outline:0;
focus shadow-outline box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);

带边框

带边框取消了阴影shadow取而代之的是border,适合在纯色背景中使用。

白底带边框

<input type="text" class="relative outline-none border border-gray-400 rounded py-1 px-2 w-full bg-white text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder"/>
样式 属性
relative position:relative;
outline-none outline:0;
border border-gray-400 round -
px-2 py-1 padding:.25rem .5rem;
w-full width:100%;
bg-white background-color:white;
shadow box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
text-sm text-gray-700 font-size:.875rem; color:#b83280;

输入框尺寸

input size

标识 尺寸 样式 属性
small 小型 py-1 px-2 text-sm padding:.25rem .5rem; font-size:.875rem;
regular 普通 py-3 px-3 text-sm padding:.75rem; font-size:.875rem;
large 大型 py-4 px-3 text-base padding:1rem .75rem; font-size:1rem;
<input type="text" class="relative outline-none rounded py-1 px-2 w-full bg-white shadow text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" /><input type="text" class="relative outline-none rounded py-3 px-3 w-full bg-white shadow text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" /><input type="text" class="relative outline-none rounded py-4 px-3 w-full bg-white shadow text-base text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" />

输入框图标

输入框左右侧的图标采用Flex弹性容器和绝对定位结合方式实现

input with icon

左侧图标

input with left icon

<div class="relative mb-3 w-full flex flex-wrap items-stretch"><span class="absolute z-10 py-3 pl-3 w-8 h-full leading-snug bg-transparent rounded text-base font-normal text-gray-400 text-center flex items-center justify-center"><i class="fa fa-lock"></i></span><input type="text" class="relative py-1 px-2 pl-10 w-full bg-white rounded shadow outline-none text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" />
</div>

右侧图标

input with right icon

<div class="relative mb-3 w-full flex flex-wrap items-stretch"><input type="text" class="relative py-1 px-2 pr-10 w-full bg-white rounded shadow outline-none text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:shadow-outline" placeholder="placeholder" /><span class="absolute right-0 z-10 py-1 pr-2 w-8 h-full leading-snug bg-transparent rounded text-base font-normal text-gray-400 text-center flex items-center justify-center"><i class="fa fa-user"></i></span>
</div>

源代码地址

https://codepen.io/junchow/pen/eYpqWQE?editors=1000

参考UI

https://www.creative-tim.com/learning-lab/tailwind-starter-kit/presentation

http://www.taodudu.cc/news/show-4582796.html

相关文章:

  • Tailwind Border
  • 在你所有的项目中都加入 TailwindCSS 吧!
  • Tailwind Spacing
  • Tailwind Background
  • CSS库 Tailwind
  • TailWind 使用指南
  • Tailwind Size
  • CSS Tailwind
  • tailWindCSS
  • Tailwind Typographic
  • Tailwind 初识
  • Tailwind教程1 - 开始使用
  • Tailwind 真香
  • vue3.2之 Tailwind CSS
  • Tailwind教程2 - 基础样式
  • 学习Vue3 第三十四章(Vue3集成Tailwind CSS)
  • 船说CMS模板 - 笔趣阁自适应模板
  • Python爬虫爬取笔趣阁小说
  • 爬虫实战|从笔趣阁爬取书籍并简单保存
  • 1.4 爬虫-笔趣阁获取小说例子
  • Python爬虫--笔趣阁小说爬取
  • xpath爬取笔趣阁小说
  • 初学爬虫-笔趣阁爬虫
  • 1.python爬取笔趣阁小说
  • python3爬取笔趣阁小说
  • java爬虫爬取笔趣阁小说
  • python爬取小说爬取_用python爬取笔趣阁小说
  • 用python爬取笔趣阁小说并分章节保存到本地
  • python下载笔趣阁小说生成txt文档
  • 爬虫练习-爬取笔趣阁小说

Tailwind Input相关推荐

  1. Tailwind Base

    添加基础样式 - 使用Tailwind添加全局的基础样式 全局基础样式是样式表开头的样式,用于为基础HTML元素设置有效的默认值,或应用自定义重置样式. Tailwind包括一组实用的基础样式集称为p ...

  2. Tailwind Button

    按钮组 input group 源代码查看地址 https://codepen.io/junchow/pen/dyGowYg?editors=1000 按钮组是由多个按钮水平排列而成,实现方式可分为两 ...

  3. [Tailwind] Control What Variations are Generated for Each Utility Class Module in Tailwind

    In this lesson, we learn how to control what utility classes are generated for each utility class mo ...

  4. tailwindcss 官网(五)核心概念:添加新的功能类、函数与指令(@tailwind、@apply、!important、@layer、@variants、 theme())、px、em、rem

    tailwindcss 官网(五)核心概念:添加新的功能类.函数与指令(@tailwind.@apply.!important.@layer.@variants.@responsive. theme( ...

  5. Tailwind Toggle

    https://codepen.io/junchow/pen/VweLgOb?editors=1000 切换 toggle <div class="relative inline-bl ...

  6. 解决烦人的img与input不能水平对齐的问题

    <STYLE type="text/css"><span style="color:#ff0000;">input,img {verti ...

  7. react控制 input 框回车之后内容清空

    state: IState = {items: [],data: '', //data是输入框的当前内容 }updateState = (e) => {this.setState({ data: ...

  8. adb 输入很长的内容 (input text) 在模拟机输入框里面快速输入内容

    有时候需要在模拟机上面输入很长的内容来测试, 可以使用input text xx 来输入 步骤1 adb shell 步骤2 input text xxxxxxxx 注意:需要先清理模拟输入框里面的内 ...

  9. python raw_input 与 input 的区别

    raw_input 是python 2x 中独有功能 ,python 3x 已经已经删除raw_input 所以在python 3x 中使用raw_input 会报错的 raw_input([prom ...

最新文章

  1. python绘制所有特征的密度图(density plot)
  2. MAX3232EUE小知识
  3. 经验|博士毕业,也写一些发文章的心得
  4. C语言运算符优先级 详细列表
  5. [BZOJ2324][ZJOI2011][最小费用最大流]营救皮卡丘
  6. C++ 预编译头文件
  7. 论文小综 | 知识图谱中的复杂查询问答
  8. 个人猜测一下《黑神话:悟空》的部分剧情
  9. 一步步教你实现富文本编辑器(第四部分)
  10. 性能分析工作strace命令用法详解及使用例子
  11. Java单例模式实现(线程安全)
  12. 初探JavaScript PDF blob转换为Word docx方法
  13. BT5R3安装及汉化
  14. 第一本书应考虑哪些细节?
  15. JavaScript事件代理(事件委托)
  16. matlab单容建模仿真,大学毕业论文-—基于matlab的过程控制系统仿真研究
  17. oracle上机题库_Oracle笔试题库附参考答案
  18. siri快捷指令_如何使用siri快捷方式来记录警察的遭遇
  19. 2021-4-21大学化学无机原理(8)缓冲溶液及pH值的计算,溶度积规则。
  20. 【区块链技术开发】剖析区块链Ganache模拟器工具及其智能合约部署区块链的查询方式

热门文章

  1. debian linux镜像下载,Debian Wheezy 7.7 发布,已提供镜像下载更新
  2. 致敬最美逆行者网页设计作品 大学生抗疫感动专题网页设计作业模板 疫情感动人物静态HTML网页模板下载
  3. 2022机修钳工(高级)考试题库模拟考试平台操作
  4. 利用Calendar简洁制作万年历
  5. R文本挖掘-文章关键词提取
  6. 西门子定位器的功能和分类!
  7. JS中冒泡排序从小到大以及从大到小
  8. Hopcroft–Karp algorithm
  9. 中国最牛十大风险投资机构
  10. 选择一款舒心的MD编辑器