Prabath Prabath - 2 months ago 5
CSS Question

Need to create always to div

I am going to make a website like this http://watcherboost.com/

SO i want to create middle menu for my website.so i need to create a div tag which is always top on following background:

This is the code i tried



<form id="form1" runat="server">
<div>

<div id="top" style="background-color:#072530; height: 30px;margin-top: -10px;margin-left:auto;margin-right:initial">

</div>

</div>
</form>
<div style="height: 300px;background-color: #0E5D7B; margin-top: 0px;">
</div>

<div style="background-color:#072530; height: 30px;margin-top: -10px;margin-left:auto;margin-right:initial">

</div>

<div style="height: 650px; background-color: #C2C2C2; margin-top: 0px;">
</div>
<div style="background-color:#072530; height: 30px;margin-top: -10px;margin-left:auto;margin-right:initial">

</div>
<div style="height: 300px;background-color: #0E5D7B; margin-top: 0px;">
</div>
<div style="background-color:#072530; height: 30px;margin-top: -10px;margin-left:auto;margin-right:initial">

</div>

<div id="middle" style="margin-left: 150px;margin-right:150px;margin-top:-250px;background-color:black"></div>





I want to get this last div (id =middle) to always top mode like upper website.
But unfortunately my div (id=middle) is not showed the page..

Please advice how to edit this code
Thanks

Answer

Your div is not showing up, because it doesn't contain any content. Add height property to its inline CSS.

Comments