dongyun3897
dongyun3897
2015-12-12 19:21

为PHP添加的DIV标记添加边距

已采纳

I want to add margin to this <div>:

$notification_list .= "
    <div class='FriendRdiv'>
        <a href='main.php?u=".$initiator."'>
            <img src='../img/".$pr."' id='FriendRPP'>
        </a>
        <a id='FriendRfrom'>".$initiator." sent you a friend request</a>
    </div>
    <form class='FriendRForm Rejecat' onsubmit='return false'>
        <input type='submit' value='Reject' id='Reject'>
    </form>         
    <form class='FriendRForm' onsubmit='return false'>
         <input type='submit' value='Accept' id='Accept'>
    </form>";

I don't know how many notifications I will get, so I want each <div> to have a bigger margin than one before it.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doufei7464 doufei7464 6年前

    you can use style attribute

    <div class='FriendRdiv' style="margin: 10px;">
    

    or you can use css for that in css file

    .FriendRdiv{
       margin: 10px;
    }
    
    点赞 评论 复制链接分享

为你推荐