尝试在google地图搜索旁添加一个按钮:使用css和引导程序进行对齐困难

尝试在google地图搜索旁添加一个按钮:使用css和引导程序进行对齐困难,css,twitter-bootstrap,google-maps,Css,Twitter Bootstrap,Google Maps,似乎什么都没用!!! 这是其中一个尝试: 我想要一个搜索按钮旁边的搜索栏,在谷歌地图。 布局和代码基本上是一行接一行的: 我还尝试了float和inline,它们都不起作用。 请帮忙 您可以使用jquery google.maps.event.addListenerOnce(map, 'idle', function(){ //loaded fully $('#pac-input').after( '<button class="btn btn-default" type="su

似乎什么都没用!!! 这是其中一个尝试:

我想要一个搜索按钮旁边的搜索栏,在谷歌地图。 布局和代码基本上是一行接一行的:

我还尝试了float和inline,它们都不起作用。 请帮忙

您可以使用jquery

google.maps.event.addListenerOnce(map, 'idle', function(){
  //loaded fully

 $('#pac-input').after( '<button class="btn btn-default" type="submit">Button</button>' );

});

非常感谢。我完全可以看出这是可行的,不过看起来很尴尬。我已经有一连串的回电了,我的代码看起来不太好。你是说你的html是如何在javascript中出现的吗?不是真的。我只是担心执行的顺序:我有一大堆我想执行的东西,它们是由google.maps.event.adddomstener运行的(窗口“加载”,并且更担心搜索按钮是否会位于标记的顶部,或者取决于首先加载的顺序。但我会尝试看看会发生什么。你的建议非常有用!不,你非常有用!至少现在我确信我对纯css、引导和hav可能无能为力你帮我节省了几个小时的修修补补时间!谢谢!如果这回答了你的问题,请勾选我答案旁边的复选标记。
#map-canvas {
height: 400px;
width: 100%;
}

.row{
display: table-row;
}

.controls {
   ..... (not important)
  }

#pac-input {
....
display: table-cell;
}

#pac-input:focus {
    border-color: #4d90fe;
}

#searchspot {
....
display: table-cell;
}
google.maps.event.addListenerOnce(map, 'idle', function(){
  //loaded fully

 $('#pac-input').after( '<button class="btn btn-default" type="submit">Button</button>' );

});
  <button id="MapButton" class="btn btn-default" type="submit">Button</button>
google.maps.event.addListenerOnce(map, 'idle', function(){
  //loaded fully

 $('#pac-input').after($('#MapButton'));

});