How to remove underline from link button in asp.net

{0 Comments}

We can solve this problem in many ways but it really depends on the condition which you may like.

  •  As asp.net link button after page load rendered as a simple hyperlink tag with some post back event. You can see this by view source option of your browser.  So first way to remove underline from link button is to use following css, but issue in using following css is that it will remove all the underlines from each hyperlink if you are ok with this condition then you can use this:
 CSS |  copy code |? 
1
<style type="text/css">
2
        a
3
        {
4
            text-decoration: none;
5
        }
6
    </style>

  •  Second method to remove underline from particular id is that to define above css rule to a particular link button id as follows:
 CSS |  copy code |? 
1
<style type="text/css">
2
        #LinkButton1
3
        {
4
            text-decoration: none;
5
        }
6
    </style>

  • Third method is help full in that case where you want to remove some under line from some link button and wants on some link button. Then you can use above css rule in following manner.
 CSS |  copy code |? 
1
<style type="text/css">
2
        .LnkBtn
3
        {
4
            text-decoration: none;
5
        }
6
    </style>

NOTE: only Id, class, tag name is changed the css rule are same this three cases.

Leave a Comment

Your email address will not be published.