In case we need to center align HTML element content using CSS.
Using below ways we can do it.
1. If element contains text, then we can do it using text-align property
text-align:center;
2. If element contains child HTML elements inside it.
position:relative;
float:left;
left:50%;
Using below ways we can do it.
1. If element contains text, then we can do it using text-align property
text-align:center;
2. If element contains child HTML elements inside it.
position:relative;
float:left;
left:50%;
No comments:
Post a Comment