Username

Fixing one div in second upper right corner using css

I have the following divs

<div id="outer"><img src="myimgpath"><div id="name">Username</div></div> 

How to fix the inner div in the upper right corner?

+4
source share
3 answers

Try something like this:

 #outer{position:relative;overflow:hidden;height:100px;} #name{position:absolute;right:0;} 
+7
source
 <div id="outer" style="position:relative"> <img src="myimgpath"> <div id="name" style="position:absolute; top:0px; right:0px;">Username</div> </div> 
+4
source

add float:right; into the inner div

+3
source

Source: https://habr.com/ru/post/1311663/


All Articles