html5 - How do I design a div with a top right corner icon? -
this question has answer here:
can me design div top right corner icon?
i need coding this.
i herewith attached sample image reference.
i see have answers explain how use relative , absolute positioning, created js fiddle in meantime :)
html:
<div id="box"> <div id="icon"> |> </div> contents of box </div>
css:
#box { position: relative; width: 200px; height: 200px; padding: 10px; margin: 100px; background-color: white; } #icon { background-color: green; color: white; padding: 10px; width: 20px; height: 20px; position: absolute; right: -20px; top: -20px; }
Comments
Post a Comment