Reputation: 1138
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
Upvotes: 3
Views: 3682
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