www.webdeveloper.com
Results 1 to 2 of 2

Thread: Usage of Margin-right

  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Usage of Margin-right

    I have a link

    <a align="right" href="http://www.google.com"><span class="plink">Click me</span></a>

    Applied css:
    .plink{
    display:block;
    margin-right: 25px;
    background-color: green
    }

    I need to position this link on the right side of this page. It works only if i put align="right".It does not work otherwise. How do you position a link on the right end of the page.

  2. #2
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,458
    Hi there klk,

    and a warm welcome to these forums.

    Try it like this...
    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    
    <meta charset="utf-8">
    
    <title>untitled document</title>
    
    <style>
    #plink{
        float:right;
        padding:4px;
        margin-right:25px;
        background-color:green
     }
    </style>
    
    </head>
    <body>
    
    <div>
     <a id="plink" href="http://www.google.com">Click me</a>
    </div>
    
    </body>
    </html>
    
    coothead

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles