Drupal 7 开发内部培训资料, 分头诗人

如何为drupal字段添加特效按钮?

赞成!
0
否决!

文件字段,默认的情况下只是一个超链接,如果想要更美观一点,就需要css来解决!我想把文件字段做成按钮,但是效果一直达不到要求,例如我想做成

当鼠标移动到按钮的时候

而他的css代码是这样的

@charset "utf-8";
/* CSS Document */

::selection {
    background-color: #55595c;
    color: #fff;
    text-shadow: 0 1px 0 #000;
}
::-moz-selection {
    background-color: #55595c;
    color: #fff;
    text-shadow: 0 1px 0 #000;
}

@font-face {
font-family: 'BebasNeueRegular';
src: url('BebasNeue-webfont.eot');
src: local('?'), url('BebasNeue-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

* {
    padding: 0;
    margin: 0;
}


html {
    height: auto;
    min-height: 100%;
}
body {
    margin: 0px;
    padding: 0px;
    height: auto;
    min-height: 100%;
    text-align: center;
    background: #242428;
    background: -webkit-gradient(linear, 0 bottom, 0 top, from(#1f1f23 ), to(#29292d));
    background: -moz-linear-gradient(-90deg, #29292d, #1f1f23 );
    text-shadow: 0  -1px 0 #000;
}


#wrap {
width:500px;
margin:13% auto 0;
}

h1 {
color:#7c7c84;
font: bold 13px/19px Arial, Helvetica, san serif;
margin-bottom:30px;
}

#btn-wrap {
position:relative;
padding:5px;
margin:0 auto;
width:230px;
height:50px;
display:block;
text-decoration:none;
margin-bottom:30px;
background: #242428;
    background: -webkit-gradient(linear, 0 bottom, 0 top, from(#2d2d30 ), to(#17171a));
    background: -moz-linear-gradient(-90deg, #17171a, #2d2d30 );
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px;
    -webkit-box-shadow: 0 1px 0 #37373b;
    -moz-box-shadow: 0 1px 0 #37373b;
    box-shadow: 0 1px 0 #37373b;
}

span.title{
color:#d6d6e7;
font:30px/58px "BebasNeueRegular", Helvetica, Arial, sans-serif;
height:50px;
width:230px;
display:block;
position:relative;
    -webkit-box-shadow: 0 -1px 0 #8d8d94, 0 1px 1px #0b0b0c;
    -moz-box-shadow:  0 -1px 0 #8d8d94, 0 1px 1px #0b0b0c;
    box-shadow:  0 -1px 0 #8d8d94, 0 1px 1px #0b0b0c;
background: #52525c;
    background: -webkit-gradient(linear, 0 bottom, 0 top, from(#383840 ), to(#5a5a64));
    background: -moz-linear-gradient(-90deg, #5a5a64, #383840 );
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px;
z-index:5;
-webkit-transition:width .2s ease-out;
-moz-transition:width .2s ease-out;
-o-transition:width .2s ease-out;
}

#btn-wrap:hover span.title {
font-size:19px;
width:135px;
}

#info {
position:absolute;
height:50px;
width:230px;
top:5px;
right:4px;
-webkit-box-shadow: 0 -1px 0 #404042, 0 1px 1px #0b0b0c;
    -moz-box-shadow:   0 -1px 0 #404042, 0 1px 1px #0b0b0c;
    box-shadow:   0 -1px 0 #404042, 0 1px 1px #0b0b0c;
background: #2a2a2d;
    background: -webkit-gradient(linear, 0 bottom, 0 top, from(#212124 ), to(#2a2a2d));
    background: -moz-linear-gradient(-90deg, #2a2a2d, #212124 );
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px;
z-index:4;
}

#info p {
width:65px;
margin:12px 17px 0 0;
position:absolute;
right:0;
color:#7c7c84;
font:11px/12px Helvetica, Arial, sans-serif;
text-align:left;
}

.boxtuffs {
color: #7c7c84;
font:12px Helvetica, Arial, sans-serif;
text-shadow: 0  -1px 0 #000;
text-decoration:none;
-webkit-transition:all .2s ease-out;
-moz-transition:all .2s ease-out;
-o-transition:all .2s ease-out;
}

.boxtuffs:hover {
color: #27896a;
}

 

但是我添加进去的时候,效果完全没有体现出来,我不知道我那一步没做对,还请谈一下详细的步骤或方法

2 个回答

赞成!
0
否决!

css代码跟前端的id 、 class 是要对应的,你确定是有对应了?这个代码要套入,不是单纯把css 拷贝过来就可以的

赞成!
0
否决!

class我是添加了自定义的类。前端id这里我可能就卡壳了.....能不能告诉我前端id这个怎么寻找添加?