试图让这个div有多个元素响应

时间:2015-06-28 22:11:54

标签: twitter-bootstrap

div包括标题,文本框和按钮。截至目前,当在屏幕上打开页面时。 div比屏幕占用更多空间而不是保持在屏幕宽度内。请帮忙!

HTML

<body style="padding-bottom: 70px; padding-top: 70px;">
<div class="container" style="margin:3em 0em 2em 100px;">   
<div class="row">
  <div class="col-md-4">
    <div class="mainText">
  <h3 style="margin-top:2%">Look for Storage in Your Community</h3>
  <span class="glyphicon glyphicon-map-marker"></span>
    <input id="searchTextField" type="text" size="45" style="height:2.0em; margin-top:1em; max-width:80%"> 
    <input type="button" id="btnSearch" value="Search" style="width:25em; height:2em; margin:1em 0em 0em 1.4em; max-width:80%">
    </div>
  </div>
  <div class="col-md-4">    
  </div>
  <div class="col-md-4">    
  </div>
</div>

    </div>
</body>

CSS

.mainText {
    border-radius: 15px 50px;
    border: 2px solid #085DF3;
    padding: 5px; 
    width:400px ;   
    height:17em;    
    text-align:center;
    font-family: Arial; 
    color:#085DF3;
    background-color:rgba(167,160,160,0.2);
    float:left; 
}

0 个答案:

没有答案