简体   繁体   中英

Add a close button to fieldset

I created the html fieldset with some textbox inside. 在此输入图像描述

I want to add a close button to the fieldset using only css like this. 在此输入图像描述

Is it possible? If it is, help me please. Here is my jsfiddle

i updated your fiddle http://jsfiddle.net/ukx35/18/

<fieldset style="position:relative">
  <legend>Title</legend>
     <input type="text"/>
    <button style="position: absolute;right:10px;top:-5px;outline:5px solid #fff">
        <img src="http://icons.iconarchive.com/icons/hopstarter/sleek-xp-basic/16/Close-2-icon.png"/>
    </button>
</fieldset>

use position absolute for the close button and position relative for your fieldset

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM