Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
.type1
{
text-align:center;
width:100px;
height:100px;
background:yellow;
border:5px solid red;
position:absolute;top:30px;left:500px;
}
<div class="circleBase type1"><p>صفحه اصلی</p></div>

how can i set to css that my text in div be in middle
Posted

1 solution

Try line-height like this:
CSS
.type1 {
    text-align: center;
    line-height: 70px;
    width: 100px;
    height: 100px;
    background: yellow;
    border: 3px solid red;
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900