Containing text in circle


#1


Design A Button Last step page 6


How do i contain text inside the circle? Ive tried text-align and margin:auto.


		<div>
			<a href="https://www.codecademy.com/"> codecademy</a>
		</div>
 

div {
    height: 100px;
    width: 100px;
    border-color: #6495ED;
    background-color: #BCD2EE;
    border-style: solid;
    border-width: 2px;
    border-radius: 50px;
    margin: auto;
    text-align: center;
    
}

a {
    text-decoration: none;
    font-family: impact;
    text-align: center;  
}


#2

I cant do it for circle but was able to center it using padding and making it rectangle shape with curved edges

div {
height: 25px;
** width: 100px;**
border-color: #6495ED;
background-color: #BCD2EE;
border-style: solid;
border-width: 2px;
border-radius: 50px;
margin: auto;
text-align: center;
padding: 2%;
}

a {
text-decoration: none;
font-family: impact;
text-align: center;
}


#3

It would be easiest to use

In the div's css.

This hides any text that goes over the border of the div.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.