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

help

help align the text in the center https://code.sololearn.com/Wn9n2WeyEt21/?ref=app

27th Nov 2021, 8:40 PM
Alexander Sokolov
Alexander Sokolov - avatar
7 Answers
+ 1
Change your textContent to innerHTML and use flex createBtn.innerHTML = "<div>запуск</div>"; //дураку понятно жто стили. createBtn.style = "position:fixed;top:350px;left:0;background-color:orange;width:60px;height:60px; display: flex; justify-content: center; align-content: center;flex-direction: column";
27th Nov 2021, 9:07 PM
Alexey Kopyshev
Alexey Kopyshev - avatar
+ 1
window.onload = function() { let dv = document.createElement("div"); dv.style = "text-align:center;"; document.body.appendChild(dv); let btn = document.createElement("button"); btn.id = "pusk"; btn.textContent = "запуск"; btn.style = "background-color:orange;"; dv.appendChild(btn); }
28th Nov 2021, 12:00 AM
SoloProg
SoloProg - avatar
0
Jay Matthews bro is not work ing.. sorry
27th Nov 2021, 8:58 PM
Alexander Sokolov
Alexander Sokolov - avatar
0
thanks evebordy
27th Nov 2021, 9:10 PM
Alexander Sokolov
Alexander Sokolov - avatar
28th Nov 2021, 9:34 PM
Zubae
Zubae - avatar
- 1
body{ text-align: center; }
27th Nov 2021, 8:55 PM
JRAMAHES
JRAMAHES - avatar
- 1
Jay Matthews plz send my your working code ok?
27th Nov 2021, 8:59 PM
Alexander Sokolov
Alexander Sokolov - avatar