Image captions and wrapping

后端 未结 6 1129
误落风尘
误落风尘 2021-01-02 18:41

What\'s the best way to add a caption below an image? The image and its caption will be floated right, and the text on the caption needs to wrap -- a 200x200px image should

6条回答
  •  情书的邮戳
    2021-01-02 19:17

    The basic idea is to make one

    with an tag and

    tag.

    my caption

    Now you simply set two styles. One for the img tag and the other for the p tag for the photo class.

    Create a class name it photo:

    .photo {float: right;width: 210px;margin: 0 10px 10px 10px;}
    img.photo {float: right;margin-left: 10px;margin-bottom: 10px;border: 1px solid #666;
    

    padding: 10px;}

    Conclusion: 1. A div with an tag and a

    tag. 2. Div should have one class with different styles for

    and tag.

提交回复
热议问题