doutuo3899 2014-03-24 20:41
浏览 56
已采纳

css取决于div标签值

I am developing a website which uses SQL and php to generate a div block. This div block will have an associated number (the range of which will probably be 1 - 100). I need the CSS to display the div element in relation to the associated number (e.g. the associated number is the margin-left % value).

How do I do this?

Thanks

  • 写回答

2条回答 默认 最新

  • dongqi19827 2014-03-24 20:45
    关注

    Supposing that $result is the number generated by php, you could write a script like this

    <?php
    $result = 1;
    echo '<div style="margin-left:'.$result.'">Div content</div>';
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ensp的问题(需要各个路由器命令)
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题