olgacosta
olgacosta

Reputation: 1138

Add a close button to fieldset

I created the html fieldset with some textbox inside. enter image description here

I want to add a close button to the fieldset using only css like this. enter image description here

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

Upvotes: 3

Views: 3682

Answers (1)

mador
mador

Reputation: 1223

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

Upvotes: 3

Related Questions