0
CSS Position fixed
Why do we not need to set the horizontal position on the span element? <!DOCTYPE html> <html> <head> <title>positin fixed</title> </head> <body> <div style="background:blue;height:84px;width:84px">one <span style="background:red;position:fixed;margin-top:42px;">two</span> </div> </body> </html>
2 Antworten
+ 5
Ask for what?
While margin-top is the answer!
position:fixed is no need then
- 1
maybe because fixed elements has default x,y position = 0