由于P和其他一些标签不能按钮标签,最好的解决方法中使用,如其他人所说,是用一个风格SPAN标记。
基本上你把BUTTON标签看作“好像”它是你的SPAN标签的容器DIV。这样你可以设计你的整个按钮的样式。在我的例子中,我用一个模拟图标,模拟标题标记,模拟描述和按钮内的模拟按钮对其进行了设置。
我为视觉目的添加了一些额外的样式和格式,但您可以像想要的那样简单或复杂。
风格:
/* CSS Styling and classes example */
/* style the main container */
button {
background-color:transparent;
outline:none;
border:none;
cursor:pointer;
transition:0.2s;
padding:10px 15px;
}
/* what happens when you hover - optional */
button:hover { background-color:#efefef; }
/* what happens when it's active - optional */
button.active { background-color:#ccc; }
/* global style for the contained span tags within */
button span {
display:block;
margin:5px auto 10px;
}
/* individually styling the inner span tags by class identifiers */
button span.step {
background:#c33;
color:#fff;
padding:10px 2px 0 0;
font-size:1.75em;
font-weight:600;
width:40px;
height:40px;
border-radius:20px;
}
button span.title { font-size:2em; font-weight:600; }
button span.desc { font-size:1.05em; }
button span.btn {
margin:20px auto;
padding:5px 10px;
background:#c33;
color:#fff;
}
HTML:
<!-- html code -->
<button class="customClass">
<span class="step">1</span>
<span class="title">Title</span>
<span class="desc">My cool button description</span>
<span class="btn">Click Here</span>
</button>
当然,你可以修改,添加和删除span元素,你认为合适,包括图像。
你使用的是什么版本的visual studio? – 2014-09-23 18:42:15
我正在使用版本2012. – Cornelis 2014-09-23 18:45:18