Positioning text/button | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Positioning text/button

How do you put a text/button to where you want it (spot)?

27th Mar 2019, 4:49 AM
Ginfio
Ginfio - avatar
3 Answers
27th Mar 2019, 5:12 AM
Nikhil
Nikhil - avatar
+ 1
Group your button and text using a div.class Set the .class with position: relative; and position point with top and left selector. Eg. <!DOCTYPE html> <html> <head> <title>Page Title</title> <style> .button-grp { position: relative; top: 50px; left: 20px; } </style> </head> <body> <div class="button-grp"> <p>Press the button</p> <button>Button</button> </div> </body> </html>
27th Mar 2019, 5:58 AM
Calviղ
Calviղ - avatar
0
k, thx
27th Mar 2019, 6:07 AM
Ginfio
Ginfio - avatar