Googleマップ(私はgmaps4railsを使用しています)の横に検索結果を含むサイドバーを配置しようとしています。私は彼らに並んでましたが、問題は、サイドバーは、マップの長さは、ここで画像SideBar with google Map.私はサイドバーを自分のGoogleマップの隣に置いておくのが難しいです - gmaps4rails
を見拡張しないで、私のコードはここに私の見解で
<div id="sideBar" class="pre-scrollable">
<h2><%= @count%> results found </h2>
<br>
<% @maps.each do |map| %>
<div>
<div class="" id="map_<%= map.id %>">
<h4>
<%= link_to map.number, controller: "maps", action: "show", id: map.id%>
</h4>
<hr>
</div>
</div>
<% end %>
<%= link_to 'Return to Main Map', maps_path %>
</div>
<div id="map_wrapper">
<div id="map" style='width: 100%; height: 100%;'></div>
</div>
あるCSSの私のコードです:
#map_wrapper {
margin-left: 300px;
height: 800px;
}
#sideBar{
width: 300px;
height: 800px;
position: absolute;
}
私の目標は、横並びと正確に同じ長さを持つことです。
'.wrapper {ディスプレイを' .wrapper'要素の両方ラップ試し、及び使用:曲がります。 } '。 '#map_wrapper'からマージンを取り除き、'#sideBar'から位置を取り除いてください。 –
@MichaelCoker言われた変更を加えようとしましたが、うまくいかなかったのです。私を助けてくれてありがとう。私はそれを正しくしようとし続け、そうするときに私の答えを更新します。 –