Placing an image to the top right corner - CSS

后端 未结 3 491
野性不改
野性不改 2020-12-04 08:10

I need to display an image on the top-right corner of a div (the image is a \"diagonal\" ribbon) but keeping the current text contained in an internal div, like stuck to the

3条回答
  •  没有蜡笔的小新
    2020-12-04 08:38

    Position the div relatively, and position the ribbon absolutely inside it. Something like:

    #content {
      position:relative;
    }
    
    .ribbon {
      position:absolute;
      top:0;
      right:0;
    }
    

提交回复
热议问题