html - 如何改进我的 HTML/CSS 按钮的呈现?

标签 html css button

我几乎达到了想要的外观,我删除了不相关的 html,我想改进按钮的外观。

enter image description here

我创建了一个 fiddle对于按钮。

我认为颜色很好(蓝色),目的是使文本渲染和外观更清晰。文本如何看起来不那么模糊并且具有更鲜明的对比? CSS 是

html {
    height: 100%;
    overflow-y: scroll;
}

body {
    background-color: rgb(255, 255, 235);
    font-family: Verdana, sans-serif;
    font-size: 12px;
    line-height: 16px;
    color: rgb(0, 0, 0);
    height: 100%;
    text-align: center;
    background-position: initial initial;
    background-repeat: initial initial;
}


#post {
    display: block;
    position: absolute;
    top: 16px;
    right: 0px;
    height: 46px;
    line-height: 46px;
}

#post a {
    color: rgb(255, 255, 255);
    text-shadow: rgb(255, 244, 210) 1px 1px 2px;
    font-size: 20px;
}

#post a:hover, #post a span:hover {
    text-decoration: none;
}


#ad {
    display: inline-block;
    border: 1px solid rgb(0, 0, 0);
    width: 290px;
    height: 45px;
    font-size: 150%;
    text-decoration: none;
    text-align: center;
    color: rgb(255, 255, 255);
    font-weight: bold;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
    background-image: -webkit-linear-gradient(top, rgb(109, 179, 242) 0%, rgb(84, 163, 238) 50%, rgb(54, 144, 240) 51%, rgb(30, 105, 222) 100%);
    background-position: initial initial;
    background-repeat: initial initial;
}



#post {
    display: inline-block;
    border: 1px solid black;
    width: 290px;
    height: 45px;
    font-size: 150%;
    text-decoration: none;
    text-align: center;
    color: white;
    font-weight: bold;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    background: #6db3f2; /* Old browsers */
    background: -moz-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6db3f2), color-stop(50%, #54a3ee), color-stop(51%, #3690f0), color-stop(100%, #1e69de)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* IE10+ */
    background: linear-gradient(to bottom, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6db3f2', endColorstr='#1e69de', GradientType=0); /* IE6-9 */
}

#post {
    display: block;
    position: absolute;
    top: 16px;
    right: 0;
    height: 46px;
    line-height: 46px;
}

#post span {
    display: block;
    float: left;
    height: 52px;
}

#post a {
    color: #FFF;
    text-shadow: 1px 1px 2px #FFF4D2;
    font-size: 20px;
}

#post a:hover, #post a span:hover {
    text-decoration: none;
}


#ad {
    display: inline-block;
    border: 1px solid #000;
    width: 290px;
    height: 45px;
    font-size: 150%;
    text-decoration: none;
    text-align: center;
    color: #FFF;
    font-weight: 700;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    background: #6db3f2;
    /* Old browsers */
    background: 0;
    /* FF3.6+ */
    background: 0 color-stop(50%, #54a3ee), color-stop(51%, #3690f0), color-stop(100%, #1e69de));
    /* Chrome,Safari4+ */
    background: 0;
    /* Chrome10+,Safari5.1+ */
    background: 0;
    /* Opera 11.10+ */
    background: 0;
    /* IE10+ */
    background: linear-gradient(tobottom, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%);
    /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6db3f2', endColorstr='#1e69de', GradientType=0);
    /* IE6-9 */
}

最佳答案

更改 #post a 上的文本阴影(并删除重复的定义)例如

#post a {
    color: #FFF;
    text-shadow: 1px 1px 2px #333;
    font-size: 20px;
}

演示:http://jsfiddle.net/4u4T7/5/

关于html - 如何改进我的 HTML/CSS 按钮的呈现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22538917/

相关文章:

html - Flickity 轮播卡片相互重叠

java - 如何在 setOnAction 外部使用定义在其内部的变量?

javascript - Bootstrap 数据切换 ="button"不适用于 <span>

javascript - 导航栏不再滚动到页面上的部分?

html - 如何防止所有页面都打印thead

javascript - 使用 JQuery 更新表单提交上显示的 div

html - table td width 指定多2px

html - 什么替代了 HTML5 表格中的 cellpadding、cellspacing、valign 和 align?

php - AdminLTE-3 激活侧边导航栏

javascript - 按钮输入上的 CSS 取消 jQuery 中的 prop disabled 属性