谷歌的无图像按钮

2024-01-31

最近有几篇关于谷歌新的无图像按钮的文章:

  • http://stopdesign.com/archive/2009/02/04/recreating-the-button.html http://stopdesign.com/archive/2009/02/04/recreating-the-button.html
  • http://stopdesign.com/eg/buttons/3.0/code.html http://stopdesign.com/eg/buttons/3.0/code.html
  • http://stopdesign.com/eg/buttons/3.1/code.html http://stopdesign.com/eg/buttons/3.1/code.html
  • http://gmailblog.blogspot.com/2009/02/new-ways-to-label-with-move-to-and-auto.html http://gmailblog.blogspot.com/2009/02/new-ways-to-label-with-move-to-and-auto.html

我真的很喜欢这些新按钮在 Gmail 中的工作方式。如何在我的网站上使用这些或类似的按钮?是否有具有类似外观和感觉的开源项目?

如果我想使用 JQuery/XHTML/CSS 滚动我自己的按钮包,我可以使用哪些元素?我最初的想法是:

  1. 标准<input type="button">用css来改善外观(设计文章主要讲涉及到的css/images。)

  2. Jquery javascript 调出一个自定义对话框,该对话框植根于“onclick”事件上的按钮<a>其中的标签和用于过滤的搜索栏?该弹出窗口的表格布局是否合理?

我不擅长对网络上的东西进行逆向工程,我可以使用哪些工具来帮助对这些按钮进行逆向工程?使用 Firefox 的 Web 开发人员工具栏,我无法真正看到按钮弹出对话框中使用的 css 或 javascript(即使已缩小)。我可以使用什么浏览器工具或其他方法来查看它们并获得一些想法?

我不想窃取任何 Google 的 IP,只是了解如何创建类似的按钮功能。


- 编辑 - 我没有看到原始帖子中的链接。对不起!将尝试重写以反映实际问题

StopDesign 在这方面有一篇很棒的文章here http://stopdesign.com/archive/2009/02/04/recreating-the-button.html. [编辑 20091107] 这些是作为闭包库 http://code.google.com/closure/: 参见按钮演示 http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/button.html.

基本上他的自定义按钮shows http://stopdesign.com/eg/buttons/3.0/code.html使用简单的 CSS 创建。

He originally used 9 tables to get the effect: 9 Tables

但后来他在上下边框上使用了简单的1px左右边距来达到同样的效果。

The gradient is faked by using three layers: Button Gradient

所有代码都可以在以下位置找到自定义按钮 3.1 http://stopdesign.com/eg/buttons/3.1/code.html页。 (虽然没有图像的渐变仅适用于 Firefox 和 Safari)

分步说明

1 - 插入以下 CSS:

/* Start custom button CSS here
---------------------------------------- */
.btn {
  display:inline-block;
  background:none;
  margin:0;
  padding:3px 0;
  border-width:0;
  overflow:visible;
  font:100%/1.2 Arial,Sans-serif;
  text-decoration:none;
  color:#333;
  }
* html button.btn {
  padding-bottom:1px;
  }
/* Immediately below is a temporary hack to serve the 
   following margin values only to Gecko browsers
   Gecko browsers add an extra 3px of left/right 
   padding to button elements which can't be overriden.
   Thus, we use -3px of left/right margin to overcome this. */
html:not([lang*=""]) button.btn {
  margin:0 -3px;
  }
.btn span {
  background:#f9f9f9;
  z-index:1;
  margin:0;
  padding:3px 0;
  border-left:1px solid #ccc;
  border-right:1px solid #bbb;
  }
* html .btn span {
  padding-top:0;
  }
.btn span span {
  background:none;
  position:relative;
  padding:3px .4em;
  border-width:0;
  border-top:1px solid #ccc;
  border-bottom:1px solid #bbb;
  }
.btn b {
  background:#e3e3e3;
  position:absolute;
  z-index:2;
  bottom:0;
  left:0;
  width:100%;
  overflow:hidden;
  height:40%;
  border-top:3px solid #eee;
  }
* html .btn b {
  top:1px;
  }
.btn u {
  text-decoration:none;
  position:relative;
  z-index:3;
  }

/* pill classes only needed if using pill style buttons ( LEFT | CENTER | RIGHT ) */
button.pill-l span {
  border-right-width:0;
  }
button.pill-l span span {
  border-right:1px solid #ccc;
  }
button.pill-c span {
  border-right-style:none;
  border-left-color:#fff;
  }
button.pill-c span span {
  border-right:1px solid #ccc;
  }
button.pill-r span {
  border-left-color:#fff;
  }

/* only needed if implementing separate hover state for buttons */
.btn:hover span, .btn:hover span span {
  cursor:pointer;
  border-color:#9cf !important;
  color:#000;
  }

/* use if one button should be the 'primary' button */
.primary {
  font-weight:bold;
  color:#000;
  }

2 - 使用以下方式之一来调用它(更多内容可以在上面的链接中找到)

<a href="#" class="btn"><span><span><b>&nbsp;</b><u>button</u></span></span></a>

or

<button type="button" class="btn"><span><span><b>&nbsp;</b><u>button</u></span></span></button>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

谷歌的无图像按钮 的相关文章

随机推荐

  • 如何查找 MySQL 表中的所有大写字符串?

    我最初认为这是微不足道的 然后认为 二进制 可以做到这一点 我现在不确定 Name John MARY Kin TED 我只想查询 MARY 和 TED 它们都是大写的 我该如何查询这个 如果您的排序规则不区分大小写 那么您需要使用BINA
  • Love2d和Lua中的继承

    我有一个包含这组值和函数的类 require class entity class new function entity new self x 100 self y 100 self width 32 self height 32 sel
  • 表单提交和Ajax同时使用onsubmit?

    如果之前有人问过这个问题 我很抱歉 但我需要通过表单提交和单击提交时触发的 ajax 调用来发送表单数据 原因是因为用户被重定向 并且我想预先将 det 表单数据存储到我的数据库中 所以我尝试使用表单 onsubmit 和 fire 提交表
  • ASP.NET 中

    我有一个在 asp net 框架上使用 SVG 坐标的网页 通过尝试错误 如果我取出大部分标签 我不会收到错误 但如果所有标签都在我收到以下错误 Compiler Error Message CS8095 Length of String
  • Asp.Net - 检测到页面上没有 javascript? (已更名标题)

    我有一个页面 在 TabContainer 中显示其所有内容 但如果浏览器上禁用了 javascript 它只会显示一个空白页面 我可以添加一个
  • 当 sed 在 mingw 中就地编辑时权限被拒绝

    我正在使用 mingw sed i s a b test txt sed preserving permissions for sed003480 Permission denied 我可以触摸 rm当前目录中的文件 这是由 Windows
  • ios 7 UiView 框架问题

    我在 iOS6 和 iOS7 中运行相同的应用程序 其中有导航栏 它在 iOS6 上运行良好 但在 iOS7 中 所有视图都有点向上 就像根本没有考虑导航栏一样 我尝试更改模拟指标选项中的顶栏属性 但它不起作用 在 iOS6 中 它从导航栏
  • 在 POST/batches 请求中使用现有的 SparkSession

    我正在尝试使用Livy远程提交多个Spark jobs 假设我想执行以下操作spark submit远程任务 包含所有选项 spark submit class com company drivers JumboBatchPipelineD
  • Serilog - 无法根据属性记录到多个文件

    您好 我正在尝试使用以下命令在一个文件中记录一些消息 在另一个文件中记录其他消息Serilog 我尝试过以下配置 Log Logger new LoggerConfiguration WriteTo Map type audit name
  • ndb async 是否保证在应用程序请求完成后执行?

    我正在使用 ndb 编写一个分析模型 该模型根据应用程序请求记录一些数据 每个请求通过ndb put async调用一个ndb请求来记录数据 而客户端不关心结果 本质上 我不希望应用程序请求等待保存统计数据以进行分析 然而 我对官方文档的解
  • Android设置壁纸出错了

    所以我很久以前就在开发壁纸更换器并发布了它 一段时间后 我开始收到壁纸尺寸调整不正确的评论 我还尝试了不同尺寸的鸸鹋 它们是正确的 我正确地缩放位图等 但不知何故 android倾向于将壁纸重新缩放得更大 有办法避免吗 我的代码 Displ
  • 与 VB.NET 中的 Array() 等效吗?

    在 VB6 中你可以这样做 Dim a As Variant a Array 1 2 3 你能在 VB NET 中使用特定类型做类似的事情吗 Dim a As Integer a Array 1 2 3 Dim a As Integer N
  • 命名空间“std”中没有名为“unary_function”的模板;您的意思是“__unary_function”吗?

    刚刚将我的 Xcode 升级到 15 0 突然它开始在 RCT Folly 中出现以下错误 No template named unary function in namespace std did you mean unary funct
  • 在运行时转储 gcov 数据

    我正在使用 gcov 收集我正在从事的 C 项目的代码覆盖率数据 据我所知 一旦程序完成后退出 gcov 就会转储代码覆盖率数据 如何收集长时间运行的进程的 gcov 数据 比如说 我的程序是一个操作系统的内核 该操作系统在永不关闭的服务器
  • iOS:Xcode 中的 ImageMagick 编译器警告

    我在 iOS 项目中使用 ImageMagick 但是该库已经过时 因为以前的开发人员使用了源代码 我使用的是 Xcode 6 3 2 我想使用 Cocoapods 将 ImageMagick 集成到项目中 而不是复制源文件 然而 当我将
  • SDL_ttf找不到“SDL.h”,但main.cpp可以

    我正在编写一个 make 文件来编译一个非常简单的 SDL2 程序 到目前为止 它编译 SDL2 得很好 现在我正在编译扩展框架 SDL2 image 和 SDL ttf 看起来MAKE正确地找到了SDL ttf h 但是SDL ttf h
  • 使用 GSON 将 JSON 转换为 Java 对象时如何覆盖 Java 映射?

    我有一个 JSON 字符串 如下所示 status status date 01 10 2019 alerts labels field1 value1 field2 value2 field3 value3 field100 value1
  • Sphinx Note Block 在代码块下的列表中?

    我有一个问题 如果我想将注释块放在代码块下的列表中 它就会包含在代码块中 如果我取消缩进 列表编号会在注释后重新开始 所以基本上 我需要的是 Fixed list example First do spam Then do eggs som
  • 如何使用 BERT 找到与向量最接近的单词

    我正在尝试使用 BERT 获取给定单词嵌入的文本表示 或最接近的单词 基本上我试图获得与 gensim 类似的功能 gt gt gt your word vector array 0 00449447 0 00310097 0 024217
  • 谷歌的无图像按钮

    最近有几篇关于谷歌新的无图像按钮的文章 http stopdesign com archive 2009 02 04 recreating the button html http stopdesign com archive 2009 0