I have the following divs. The style elements will be transferred to a stylesheet as soon as i get the right combination of style elements.
I am trying to get the last div to have an absolute position relative to the div within which it exists (“one”). But it is dropping to the bottom of div “one” as though it were relative. What am i doing wrong?
<div id="one" style = "position: relative; width: 900px; height: 250px;">
<% (5 .. 14).each do |s| %>
<div style="position: relative; margin-left: 150px;"><%= @name[s] %></div>
<% end %>
<div style = "position: absolute; top: 100; left: 10;">Top Six</div>
</div>
Thanks.
Add ‘px’ to your top and left attributes: