如何水平显示2个图像及其名称?

时间:2016-01-16 18:24:37

标签: php html css

这是我的系统的主要问题我可以显示图像及其名称,但它不能是横向的..需要帮助请Here's an example pic。因为当我运行我的代码时,图像将是垂直的,但我想要处于水平

这里;代码:

echo'<?php $src=array("candidates/images/".$rows["image"]); for($i=0;$i<2;$i++){ ?>';

                            echo '<div clas ="image">';
                                        echo '<img src="candidates/images/'.$rows['image'].'" width="10" height="20px" />'.',&nbsp;'.'<br>'.$rows['lastname'].',&nbsp;'.$rows['firstname'].'<br>'.'&nbsp;=&nbsp;'.$rows['votes'];


                                        //  echo '<br>';
                                        }

                                            $sdsd=$dsada    
                                        ?>
                                    <img  src="candidates/images/percent.gif"width='<?php echo(100*round($rows['votes']/($sdsd),2)); ?>'height='10'>
                                <?php 
                                if ($rows['votes']==0){
                                echo "<br>";}
                                else {
                            //  echo(100*round($rows['votes']/($sdsd),2)); /
                            /*?>%<br>*/
    /*<?php
                            }
                            */echo '</div>';
                        }
                        }

这是CSS:

.image {
  position: relative;
  width: 150px;
  display: inline-bloxk;
}

1 个答案:

答案 0 :(得分:0)

删除<br>

echo''。','。'
'。$ rows ['lastname']。','。$ rows ['firstname']。'
'。' =” $行[ '投票'];

相关问题