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条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码