为什么我的HTML元素的大小没有变化

时间:2016-08-09 00:03:09

标签: html css

我试图改变发送'发送'按钮,但它没有响应。我知道这应该是一个简单的修复,但我不确定为什么会发生这种情况的确切原因。我想知道是否有人可以帮助我。感谢。

这是CSS:

.send{
    border-radius: 20px;
    background-color: #00e699;
    font-weight: bold;
    color: white;
    position:relative;
    width: 80%;
    height: 80%;
    top: 50px; 
    left: 32%;   
}

这是包含'发送'的HTML。按钮

<div class="infocard">
      <div class = "col-md-12" >
        <h3 class="theName"></h3>
        <h3 class="theNum"></h3>
        <h3 class="theDate"></h3>

        <input type = "text" name = "Name" size = "30" class = "textBox" ng-model = "input" />
        <a href= "" style = "text-decoration: none; color: white;" class = "send" ng-click="passPrompt()">Send Message</a>
      </div>
    </div>

2 个答案:

答案 0 :(得分:3)

只需根据需要添加显示类型

&#13;
&#13;
.send{
    border-radius: 20px;
    background-color: #00e699;
    font-weight: bold;
    color: white;
    position:relative;
    width: 50%;
    height: 80%;
    top: 50px; 
    left: 32%;   
    display:block;
}
&#13;
<div class="infocard">
      <div class = "col-md-12" >
        <h3 class="theName"></h3>
        <h3 class="theNum"></h3>
        <h3 class="theDate"></h3>

        <input type = "text" name = "Name" size = "30" class = "textBox" ng-model = "input" />
        <a href= "" style = "text-decoration: none; color: white;" class = "send" ng-click="passPrompt()">Send Message</a>
      </div>
    </div>
&#13;
&#13;
&#13;

答案 1 :(得分:2)

默认情况下,

a标记为display: inline。您需要添加display: blockdisplay: inline来添加宽度/高度样式。