tags:

views:

32

answers:

2

How to align the second div(display_bar) to the center

<div id="display" style="display:inline;font-size:150%;" > </div>
<div name="display_bar" id="display_bar" 
    style="margin-left: auto;margin-right: auto;width:125em;text-align:center;visibility=visible;display:inline;">
    <img class="view_prev" src="first.png"> 
    <img class="view_prev" src="2.png" > 
    <img class="view_prev" src="3.png" > 
    <img class="view_prev" src="4.png" > 
    <img class="view_prev" src="5.png" > 
</div>

Also the second div should be inline with the first div

Thanks.

+2  A: 

Since it is display: inline, set text-align: center on its parent element and ask yourself if it should be a span instead of a div.

(NB: CSS uses :, not = and the alt attribute is mandatory for img elements)

David Dorward
A: 

Try this css:

#display_bar
{
  margin:0 auto;
  width:300px; /* or whatever width */
}
Sarfraz