+ 1
How to align div element in code?
Actually I made some box using div but how I align it in css to center,left or right.Please help me.
3 Answers
+ 2
Use align tag .... https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_div_align âșïž
+ 1
You have to get styles to parent element of this div. For example:
<div class="parent">
<div>Hey</div>
</div>
.parent {
text-align: center; /* or left, right */
}
P.S. If you want to get vertical align then you should get the parent div flexible display (display: flex;)
P.S.S. Display: flex; - is very flexible to use)
0
Please give me another way