How to write a caption under an image?

后端 未结 9 1653
心在旅途
心在旅途 2020-11-29 19:55

I have two images that need to kept inline; I want to write a caption under each image.

9条回答
  •  粉色の甜心
    2020-11-29 20:33

    Figure and Figcaption tags:

    missing
    Caption goes here

    Gotta love HTML5.


    See sample

    #container {
        text-align: center;
    }
    a, figure {
        display: inline-block;
    }
    figcaption {
        margin: 10px 0 0 0;
        font-variant: small-caps;
        font-family: Arial;
        font-weight: bold;
        color: #bb3333;
    }
    figure {
        padding: 5px;
    }
    img:hover {
        transform: scale(1.1);
        -ms-transform: scale(1.1);
        -webkit-transform: scale(1.1);
        -moz-transform: scale(1.1);
        -o-transform: scale(1.1);
    }
    img {
        transition: transform 0.2s;
        -webkit-transition: -webkit-transform 0.2s;
        -moz-transition: -moz-transform 0.2s;
        -o-transition: -o-transform 0.2s;
    }

提交回复
热议问题