0

再见,

我正在开发一个网络应用程序,我正在尝试获取一个可点击的 div (我用<a href...>线性渐变的 CSS 中的“显示:块”样式实现了它。没问题......

然后我想在其中插入一个图标<a...>,并使用<p>包含标志性字体的方式进行操作...再次没有问题...

然后我尝试在同一块内的图标/字体下方的 calibri 中插入一些不同的文本,并具有相同的样式(我希望有一个内部阴影,使事物看起来像是“按下”)。在这里,我对结果不满意,因为我几乎无法对齐这 2 个元素(我将其设置为<p>,我应该<span>改用它吗?)。

作为示例,我想获得类似于 facebook 应用程序按钮但图像和文本垂直对齐的效果

Facebook div/链接

我该怎么做?最佳做法是什么(标志性字体 + Photoshop 中样式的字体或图像 + css 中样式的字体,还是什么?)?

PS:作为那个链接/div的边界的那两条漂亮的线呢,它们的样式如何?

4

1 回答 1

0

我认为最好的 - 用 photoshop 设计的图像 + 用 css 设计的字体 对于线条尝试使用渐变和框阴影。http://jsbin.com/esasan/1/edit

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div class="main">
    <ul class="lines">
      <li class="line"></li>
      <li class="line"></li>
    </ul>
  </div>
</body>
</html>

.main {
  display:block;
  position:relative;
  width:150px;
  height:70px;
  background: #fcfcfd; /* Old browsers */
background: -moz-linear-gradient(top,  #fcfcfd 0%, #eaecf2 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fcfcfd), color-stop(100%,#eaecf2)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #fcfcfd 0%,#eaecf2 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #fcfcfd 0%,#eaecf2 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #fcfcfd 0%,#eaecf2 100%); /* IE10+ */
background: linear-gradient(to bottom,  #fcfcfd 0%,#eaecf2 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfd', endColorstr='#eaecf2',GradientType=0 ); /* IE6-9 */
   -moz-box-sizing: border-box; 
    box-sizing: border-box; 
  -webkit-box-sizing: border-box;
}

.lines{
  position:relative;
  width:150px;
  height:64px;
  margin-top:3px;
}

.lines li {
  display:inline-block;
  margin-top:4px;
}

.line {
  width:2px;
  height:60px;
  background: #9fa0a3; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover,  #9fa0a3 0%, #f4f6fc 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#9fa0a3), color-stop(100%,#f4f6fc)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover,  #9fa0a3 0%,#f4f6fc 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover,  #9fa0a3 0%,#f4f6fc 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover,  #9fa0a3 0%,#f4f6fc 100%); /* IE10+ */
background: radial-gradient(ellipse at center,  #9fa0a3 0%,#f4f6fc 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9fa0a3', endColorstr='#f4f6fc',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
  margin-right:60px; 
}
于 2013-03-17T00:33:53.647 回答