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

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

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

  1. 使用CSS改进外观的标准<input type="button">(设计文章主要讨论了CSS/Imges涉及的内容).

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

我对网络上的逆向工程很在行,有哪些工具可以帮助我对这些按钮进行逆向工程?使用Firefox的web developer工具栏,我看不到按钮弹出对话框上使用的css或javascript(即使缩小了).我可以使用什么浏览器工具或其他方法查看它们并获得一些 idea ?

我并不想窃取谷歌的任何IP,只是想知道如何创建类似的按钮功能.

推荐答案

--编辑--我没有看到原始帖子中的链接.抱歉的!将try 重写以反映实际问题

StopDesign在这个here上有一个很好的帖子.[edit 20091107] These were released as part of the 101: see the 102.

基本上,自定义按钮是使用简单的CSS创建的.

他最初使用了9个表来获得效果:9表

但后来,他在顶部和底部边框上使用了一个简单的1px左右边距来实现同样的效果.

渐变是通过使用三个层来伪造的:src=

所有代码都可以在Custom Buttons 3.1页找到.(虽然没有图像的渐变仅在Firefox和Safari中有效)

循序渐进的说明

1-插入以下CSS:

/* Start custom button CSS here
---------------------------------------- */
.btn {
  display:inline-block;
  background:none;
  margin:0;
  padding:3px 0;
  b或der-width:0;
  overflow:visible;
  font:100%/1.2 Arial,Sans-serif;
  text-dec或ation:none;
  col或:#333;
  }
* html button.btn {
  padding-bottom:1px;
  }
/* Immediately below is a temp或ary 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;
  b或der-left:1px solid #ccc;
  b或der-right:1px solid #bbb;
  }
* html .btn span {
  padding-top:0;
  }
.btn span span {
  background:none;
  position:relative;
  padding:3px .4em;
  b或der-width:0;
  b或der-top:1px solid #ccc;
  b或der-bottom:1px solid #bbb;
  }
.btn b {
  background:#e3e3e3;
  position:absolute;
  z-index:2;
  bottom:0;
  left:0;
  width:100%;
  overflow:hidden;
  height:40%;
  b或der-top:3px solid #eee;
  }
* html .btn b {
  top:1px;
  }
.btn u {
  text-dec或ation:none;
  position:relative;
  z-index:3;
  }

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

/* only needed if implementing separate hover state f或 buttons */
.btn:hover span, .btn:hover span span {
  curs或:pointer;
  b或der-col或:#9cf !imp或tant;
  col或:#000;
  }

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

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

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

<button type="button" class="btn"><span><span><b>&nbsp;</b><u>button</u></span></span></button>

Css相关问答推荐

为什么我不能编辑垫按钮填充?

使用背景滤镜时,伪元素出现在div之前

显示Reaction组件上的问题.使用FlexBox时的意外大小

如何在react 路由中设置活动类?

具有不同边框宽度和 colored颜色 的边框半径,Safari渲染问题

根据现有值计算CSS变量的新值

在具有特定类的 td 之后,如何编写适用于该行上所有 td 元素的表行的 CSS Select 器?

使用 mixin 在 SCSS 中进行媒体查询

Mat table - 保留第一列和复选框

努力将 CSS 样式应用于 Elm 应用程序

使用 node-sass 在压缩文件末尾添加 min.css 文件扩展名

Angular Datepicker - 更改日期范围 Select 样式

使用 Webpack5 在 CSS 文件中内联字体和图像?

当我进入登录页面时,它处于桌面模式(响应式设计消失)

使用css水平+垂直翻转/镜像图像

使用 CSS 在悬停时转换 SVG 路径的填充属性

如何定位 CSS 网格布局中的特定列或行?

如何使用 CSS 绘制复选标记/勾号?

background-position-x (background-position-y) 是标准的 W3C CSS 属性吗?

bootstrap 关闭响应菜单点击