I am in the process of creating a square box that is clickable and will redirect users to another page. To achieve this functionality, as well as implement hover effects later on, I am utilizing the < a > element.
Below is the HTML markup:
<a id="about" href="">
<p>About Me</p>
</a>
Here is the CSS code for styling the element:
a#about {
display: block;
width: 300px;
height: 300px;
border: 1px solid black;
}
Although I have successfully managed to horizontally center the text using the text-align property, I am facing challenges when it comes to vertically centering the text.
I attempted to adjust margins and paddings, but they only affect the width of the container box.
Any suggestions or solutions you fellow developers might have would be greatly appreciated.
Thank you!