0

Despite writing style="text-align:right; in the <a> tag (in second last line), the link isn't getting aligned to the right side. please tell how can I align it.

    <style>
        a:link {
          color:rgb(238, 34, 34);
          background-color: transparent;
          text-decoration: none;
        }
        
        a:visited {
          color:rgb(238, 34, 34);
          background-color: transparent;
          text-decoration:none;
        }
        
        a:hover {
          color: rgb(238, 34, 34);
          background-color: rgb(248, 248, 90);
          text-decoration: underline;
        }
        a:active {
          color: yellow;
          background-color: transparent;
          text-decoration: none;
        }
        a{
            font-size: 40px;
        }
        </style>
    <body>
        <!-- -DONT FORGET TO ADD THE SUITABLE LINK IN href ATTRIBUTES:) - -->
        <a href=" " >NAME</a>

        <a href=" LINK FOR ABOUT ME!!!" style="text-align:right;">About me</a>
    </body>
Nityunj
  • 11
  • 3

1 Answers1

0

An anchor element is inline and its width adjusts according to the text. text-align: right aligns the text to the right edge of the element. Try using float: right instead:

<a href="LINK FOR ABOUT ME!!!" style="float :right;">About me</a>
Jacques Marais
  • 2,666
  • 14
  • 33