2012-04-03 63 views
0

是否有任何不错的干净方式将div的nested按钮元素置于“table”设置的样式中央?嵌套按钮+在屏幕上的位置

理想情况下,我不想在一个额外的div中包含按钮。

<div class="the-tabs"> 
    <button class="tool-button dark_mini"><img src="Tools-icon.png"></button> 
    <button class="help-button dark_mini"><img src="Info-icon.png"></button> 
    <button class="save-button dark_mini"><img src="Zoom-in-icon.png"></button> 
    <button class="save-button dark_mini"><img src="Save-icon.png"></button> 

       <div id="the_preview" style="width:<?php echo $third_w;?>px;height:<?php echo $third_h;?>px;"> 
        <div id="loading"><img src="images/loading.gif"><br/>Loading .... </div> 

        <img src="<?php echo $the_img;?>" width=" <?php echo $width_new;?>px" height=" <?php echo $height_new;?>px" id="preview" class="preview_color"/> 
       </div> 
</div> 
+1

如果你提供了一些HTML – 2012-04-03 11:58:42

回答

0

明白你的意思不是100%,但在这里不用...

.the-tabs { 
    text-align: center; 
} 

这将居中父专区内的按钮。你是这个意思吗?

JSFiddle

+0

对不起,是我写的有点快,似乎已经错过了几个关键点,这将有助于:div.the的选项卡设置为显示:表; – 2012-04-03 12:22:01

+0

谢谢你的工作。而有趣的是,我有那个在那里,但忘了我有按钮已经设置为左浮动。欢呼的帮助 – 2012-04-03 12:47:11