html - css position fixed to a location within an area -


i making list of products in shop website using asp.net , html. items showing alright, don't of button being misaligned depending on prodcut name length.

enter image description here

i trying keep details button fixed @ bottom regardless, box on product 1,3 , , 5. other products' names push text down.

these css in question.

#gamecatalogue {     list-style-type:none; } #gamecatalogue li {     /* http://blog.mozilla.org/webdev/2009/02/20/cross-browser-inline-block/ */         width: 200px;         min-height: 320px;         border: 1px solid #000;         display: -moz-inline-stack;         display: inline-block;         vertical-align: top;         margin: 5px;         zoom: 1;         *display: inline;         _height: 250px;         border-radius: 7px; }  .detailsbuttom{     position: relative;     top: 25px; /* tried, vertical-height, alignment, position fixed, absolute, messed around z-index,  moving items in different locations through li containter.  } 

and output html (for 1 item)

<li> <div class="img"> <img alt="" src="../images/mariou.jpg" id="graphic1">  </div> <div class="info"> <h3 id="name" 1'="">supermario u</h3> <p id="descr1" data-description="super mario u latest installment of classic mario franchise. 5 players simultaniously can traverse vast world spanning on 90 unique levels."> super mario u the...</p> <div class="price"><span class="st">our price:</span> <strong id="price1">$45.99</strong> </div><div class="actions"><a href="#details_popup" style="position: relative;top: 25px;" data-toggle="modal" class="btn btn-primary" data-prodcd"1"="">details</a></div></div></li> 

to start with, please notice css code you've posted doesn't match dom you've posted (in dom have no element detailsbuttom class).


to achieve want, need set position: absolute element want "stick" bottom. need set container's position position: relative. can set coordinates of inner element wish (with these attributes: left, top, right, bottom).


so, set .detailsbuttom (should written bottom) class likewise:

.detailsbuttom {     position: absolute;     bottom: 10px;     left: 0; /* can change these values */ } 

and set container's class (i assume it's li in css):

#gamecatalogue li {      position: relative; } 

further reading

  1. css tricks - absolute positioning inside relative positioning
  2. learn css positioning in ten steps

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -