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.

div top right corner icon

i see have answers explain how use relative , absolute positioning, created js fiddle in meantime :)

link js fiddle example

html:

<div id="box">   <div id="icon">     |&gt;   </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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -