dongque20030402 2012-05-27 11:49
浏览 44
已采纳

如何改变溢出?

I am doing a college project. I need to change the scrolling position from Horizontal to Vertical, But that's not working. Here I'm using PHP and HTML, CSS. Can any one fix my code please? I am new to css.

This is my current output:

My Current Output In IMAGE format

My code:

<style>
div.boxx
{
    background-color:#9C0;
    width:150px;
    height:150px;
    margin-left:20px;
    text-align:center;
    float:left;
}

div.boxx:hover
{
    background:#333;
}

div.inside1
{

    width:100px;
    height:100px;
    margin-left:auto;
    margin-right:auto;
    position:relative;
    margin-top:10px;
    bottom:0px;
    border:solid #666;
    border-width:thin;
}

div.inside2
{

    width:auto;
    height:40px;
    margin-left:auto;
    margin-right:auto;
    margin-top:5px;
    text-align:center;
}

div.button1
{
    width:15px;
    height:25px;
    left:85px;
    float:right;
    position:absolute;
    top:0px;
}

table.main_table
{
    margin-left:auto;
    margin-right:auto;
    width:auto;
}

tr.toptr
{
    background:url(images/available_gallary_top.png) no-repeat;
    height:38px;
}

tr.boatamtr
{
    background:url(images/available_gallary_bottam.png) no-repeat;
    height:7px;
}

tr.fulltr
{
    background:url(images/available_gallary_bg.png) repeat-y;
}

div.gal_cantiner
{
    background-color:#09C;
    width:869px;
    margin-left:2px;
    height:152px;
    overflow:auto;
}

input.delet_gal_bt
{
    width:13px;
    height:13px;
    background:url(images/delet_gal_bt.png) no-repeat;
    border:none;
}
input.delet_gal_bt:hover
{
    background:url(images/delet_gal_bt_h.png) no-repeat;
}

input.remove_gal_bt
{
    width:13px;
    height:13px;
    background:url(images/remove_gal_bt.png) no-repeat;
    border:none;
}
input.remove_gal_bt:hover
{
    background:url(images/remove_gal_bt_h.png) no-repeat;
}

span.gallary_date_text
{
    color:#666; 
    font-size:9px;
    line-height:15px;
}


</style>
<?php
session_start();
include "config.php";
error_reporting(0);
echo "<br>";
$crt=0;
$sql= mysql_query("SELECT * FROM new_gallary",$con);
echo "<table class='main_table' border='0' align='center'><tr class='toptr'><td>&nbsp;</td></tr><tr class='fulltr'><td><div class='gal_cantiner' id='gal_cantiner'>";
while($row = mysql_fetch_array($sql))
  {

       echo    "<div class='boxx' id='boxx".$crt."'><div class='inside1'><img src='".$galimg."' width='100' height='100'><div class='button1'><input type='button' class='delet_gal_bt' onclick='deleted_gallary(".$row['id'].")'/><input type='button' class='remove_gal_bt' onclick='remove_for_gallary(".$row['id'].")'/></div></div><div class='inside2'>".$row['gallary_name']."<br><span class='gallary_date_text'>".$row['gallary_date']."</span></div></div>";

       $crt++;
  }
echo "</div></td></tr><tr class='boatamtr'><td></td></tr></table>";
?>
  • 写回答

3条回答 默认 最新

  • duaijiao0648 2012-05-27 14:11
    关注

    I finally found the answer. I add a new style line into the tr that will inside of the loop like this:

    $l=$l+100;
    echo"
        <div class='boxx' id='boxx".$crt."' style="margin-left:".$l."px;margin-top:-160px;">
            <div class='inside1'>
                <img src='".$galimg."' width='100' height='100'>
                <div class='button1'>
                    <input type='button' class='delet_gal_bt' onclick='deleted_gallary(".$row['id'].")'/>
                    <input type='button' class='remove_gal_bt' onclick='remove_for_gallary(".$row['id'].")'/>
                </div>
            </div>
            <div class='inside2'>".$row['gallary_name'].">
                <br>
                <span class='gallary_date_text'>".$row['gallary_date']."</span>
            </div>
        </div>
    ";
    
    style="margin-left:".$l."px; margin-top:-160px;
    

    THe Final Output:Image

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图
  • ¥15 UE5.1局部变量对蓝图不可见
  • ¥15 一共有五道问题关于整数幂的运算还有房间号码 还有网络密码的解答?(语言-python)
  • ¥20 sentry如何捕获上传Android ndk 崩溃
  • ¥15 在做logistic回归模型限制性立方条图时候,不能出完整图的困难
  • ¥15 G0系列单片机HAL库中景园gc9307液晶驱动芯片无法使用硬件SPI+DMA驱动,如何解决?