onlinecode

Center a text inside anchor tag in HTML

Center a text inside anchor tag in HTML

In this post we will give you information about Center a text inside anchor tag in HTML. Hear we will give you detail about Center a text inside anchor tag in HTMLAnd how to use it also give you demo for it if it is necessary.

we are going to learn about how to center a text inside a anchor <a> tag in HTML with the help of examples.

Consider, we have the following anchor element in our HTML:

&lt;a href="https://google.com" &gt;Google&lt;/h1&gt;

To center a text inside a anchor tag, add the text-align:center to the anchor CSS class.

“text-align: center” centers the text horizontally.

Here is an example:

&lt;a href="https://google.com" &gt;Google&lt;/a&gt;

CSS:

.link{   text-align: center;}

or we can add the inline styles to anchor element using the style attribute in HTML.

&lt;a href="https://google.com" style="text-align: center;"&gt;  Google&lt;/a&gt;

Hope this code and post will helped you for implement Center a text inside anchor tag in HTML. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Exit mobile version