tags:

views:

53

answers:

3

I tried many "Display" param in CSS and seem none able to set a proper alignment, please help me to solve it.

<div id="fadeshow2toggler" style="text-align:center; width:290px;">
    <a href="#" class="prev"><img src="http://i31.tinypic.com/302rn5v.png"/&gt;&lt;/a&gt;
    <div class="status">1 of 1</div>
    <a href="#" class="next"><img src="http://i30.tinypic.com/lzkux.png"/&gt;&lt;/a&gt;
</div>
A: 

Display will not set any allignment.

This may be what you need.

<style type="text/css">
    .prev, .next, .status{float:left;}
</style>
Rocket Ronnie
great! float work but cannot center align, so I make do with margin-left, however, if you have a solution, please tell me. Thanks.
JohnMax
A: 

try this:

<center>
    <div id="fadeshow2toggler" style="text-align:center; width:290px;">
        <a href="#" class="prev"><img src="http://i31.tinypic.com/302rn5v.png"/&gt;&lt;/a&gt;
        <div class="status">1 of 1</div>
        <a href="#" class="next"><img src="http://i30.tinypic.com/lzkux.png"/&gt;&lt;/a&gt;
    </div>
</center>
PaulStack
too bad, it doesn't work as I expected.
JohnMax
you didn't really tell us what you wanted :(
PaulStack
Well, you see, your code layout differently in vertical instead of horizontally but we all feel this code are too tricky :D
JohnMax
please clarify in the original question if you want the code horizontally or vertically aligned then as i still dont know what you want it to be like
PaulStack
A: 

Can you modify the HTML? If so, add a container for the two anchors and the div like this

<div id="fadeshow2toggler" style="width:290px;">
<div class="linkscontainer">
    <a href="#" class="prev"><img src="http://i31.tinypic.com/302rn5v.png"/&gt;&lt;/a&gt;
    <div class="status">1 of 1</div>
    <a href="#" class="next"><img src="http://i30.tinypic.com/lzkux.png"/&gt;&lt;/a&gt;
</div>
</div>

And use this CSS

.linkscontainer{
  margin:0px auto;
  min-width:50%;
}

.status{
  display:inline;
}
Mark Chorley