How to globally avoid underlining links in an HTML page











up vote
-2
down vote

favorite












In HTML it seems that the default behaviour is to underline web-links. That looks quite ugly in the HTML web page I am creating.



Is there a way to avoid the underlining throughout the web page?



Here is a piece of CSS code (gleaned from the web, I seem to have lost the source, sorry) which seems to be working nicely for me, except for the underlining:



body{
background-color:#f4f4f4;
color:#555555;
font-family: Arial, Helvetica, sans-serif;
font-size: 26px;
font-weight: normal;
line-height: 1.6em;
}


<style type="text/css">
a:link {
/* Applies to all unvisited links */
text-decoration: none;
background-color: #bbb;
color: blue;
}
a:visited {
/* Applies to all visited links */
text-decoration: none;
background-color: #ddd;
color: #f0f;
}
a:hover {
/* Applies to links under the pointer */
text-decoration: none;
background-color: red;
color: #fff;
}
a:active {
/* Applies to activated links */
text-decoration: none;
background-color: black;
color: white;
}
</style>


It gives me links like this:



enter image description here



How can I modify the CSS to stop the underlining?





EDIT: Sorry there was another CSS code which was embedded inside the html file
exported from Emacs from org mode, which as ACD pointed out might be over-riding
the CSS code above. Unfortunately I am not very good at CSS at be able to recognize what the problem is :-D






<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->












share|improve this question




















  • 2




    Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
    – Adriano
    Nov 5 at 3:09












  • It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
    – Jon P
    Nov 5 at 3:27












  • @smilingbuddha, if you could provide the HTML code it would very helpful.
    – Adriano
    Nov 5 at 3:34










  • Underlining of links has been the default since the 90s. Good to see you've caught up.
    – Rob
    Nov 5 at 3:49










  • Possible duplicate of How to remove the underline for anchors(links)?
    – Welcome to Stack Overflow
    Nov 5 at 4:01















up vote
-2
down vote

favorite












In HTML it seems that the default behaviour is to underline web-links. That looks quite ugly in the HTML web page I am creating.



Is there a way to avoid the underlining throughout the web page?



Here is a piece of CSS code (gleaned from the web, I seem to have lost the source, sorry) which seems to be working nicely for me, except for the underlining:



body{
background-color:#f4f4f4;
color:#555555;
font-family: Arial, Helvetica, sans-serif;
font-size: 26px;
font-weight: normal;
line-height: 1.6em;
}


<style type="text/css">
a:link {
/* Applies to all unvisited links */
text-decoration: none;
background-color: #bbb;
color: blue;
}
a:visited {
/* Applies to all visited links */
text-decoration: none;
background-color: #ddd;
color: #f0f;
}
a:hover {
/* Applies to links under the pointer */
text-decoration: none;
background-color: red;
color: #fff;
}
a:active {
/* Applies to activated links */
text-decoration: none;
background-color: black;
color: white;
}
</style>


It gives me links like this:



enter image description here



How can I modify the CSS to stop the underlining?





EDIT: Sorry there was another CSS code which was embedded inside the html file
exported from Emacs from org mode, which as ACD pointed out might be over-riding
the CSS code above. Unfortunately I am not very good at CSS at be able to recognize what the problem is :-D






<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->












share|improve this question




















  • 2




    Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
    – Adriano
    Nov 5 at 3:09












  • It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
    – Jon P
    Nov 5 at 3:27












  • @smilingbuddha, if you could provide the HTML code it would very helpful.
    – Adriano
    Nov 5 at 3:34










  • Underlining of links has been the default since the 90s. Good to see you've caught up.
    – Rob
    Nov 5 at 3:49










  • Possible duplicate of How to remove the underline for anchors(links)?
    – Welcome to Stack Overflow
    Nov 5 at 4:01













up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











In HTML it seems that the default behaviour is to underline web-links. That looks quite ugly in the HTML web page I am creating.



Is there a way to avoid the underlining throughout the web page?



Here is a piece of CSS code (gleaned from the web, I seem to have lost the source, sorry) which seems to be working nicely for me, except for the underlining:



body{
background-color:#f4f4f4;
color:#555555;
font-family: Arial, Helvetica, sans-serif;
font-size: 26px;
font-weight: normal;
line-height: 1.6em;
}


<style type="text/css">
a:link {
/* Applies to all unvisited links */
text-decoration: none;
background-color: #bbb;
color: blue;
}
a:visited {
/* Applies to all visited links */
text-decoration: none;
background-color: #ddd;
color: #f0f;
}
a:hover {
/* Applies to links under the pointer */
text-decoration: none;
background-color: red;
color: #fff;
}
a:active {
/* Applies to activated links */
text-decoration: none;
background-color: black;
color: white;
}
</style>


It gives me links like this:



enter image description here



How can I modify the CSS to stop the underlining?





EDIT: Sorry there was another CSS code which was embedded inside the html file
exported from Emacs from org mode, which as ACD pointed out might be over-riding
the CSS code above. Unfortunately I am not very good at CSS at be able to recognize what the problem is :-D






<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->












share|improve this question















In HTML it seems that the default behaviour is to underline web-links. That looks quite ugly in the HTML web page I am creating.



Is there a way to avoid the underlining throughout the web page?



Here is a piece of CSS code (gleaned from the web, I seem to have lost the source, sorry) which seems to be working nicely for me, except for the underlining:



body{
background-color:#f4f4f4;
color:#555555;
font-family: Arial, Helvetica, sans-serif;
font-size: 26px;
font-weight: normal;
line-height: 1.6em;
}


<style type="text/css">
a:link {
/* Applies to all unvisited links */
text-decoration: none;
background-color: #bbb;
color: blue;
}
a:visited {
/* Applies to all visited links */
text-decoration: none;
background-color: #ddd;
color: #f0f;
}
a:hover {
/* Applies to links under the pointer */
text-decoration: none;
background-color: red;
color: #fff;
}
a:active {
/* Applies to activated links */
text-decoration: none;
background-color: black;
color: white;
}
</style>


It gives me links like this:



enter image description here



How can I modify the CSS to stop the underlining?





EDIT: Sorry there was another CSS code which was embedded inside the html file
exported from Emacs from org mode, which as ACD pointed out might be over-riding
the CSS code above. Unfortunately I am not very good at CSS at be able to recognize what the problem is :-D






<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->








<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->





<!--/*--><![CDATA[/*><!--*/

.title {
text-align: center;
}

.todo {
font-family: monospace;
color: red;
}

.done {
color: green;
}

.tag {
background-color: #eee;
font-family: monospace;
padding: 2px;
font-size: 80%;
font-weight: normal;
}

.timestamp {
color: #bebebe;
}

.timestamp-kwd {
color: #5f9ea0;
}

.right {
margin-left: auto;
margin-right: 0px;
text-align: right;
}

.left {
margin-left: 0px;
margin-right: auto;
text-align: left;
}

.center {
margin-left: auto;
margin-right: auto;
text-align: center;
}

.underline {
text-decoration: underline;
}

#postamble p,
#preamble p {
font-size: 90%;
margin: .2em;
}

p.verse {
margin-left: 3%;
}

pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}

pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}

pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}

pre.src:hover:before {
display: inline;
}

pre.src-sh:before {
content: 'sh';
}

pre.src-bash:before {
content: 'sh';
}

pre.src-emacs-lisp:before {
content: 'Emacs Lisp';
}

pre.src-R:before {
content: 'R';
}

pre.src-perl:before {
content: 'Perl';
}

pre.src-java:before {
content: 'Java';
}

pre.src-sql:before {
content: 'SQL';
}

table {
border-collapse: collapse;
}

caption.t-above {
caption-side: top;
}

caption.t-bottom {
caption-side: bottom;
}

td,
th {
vertical-align: top;
}

th.right {
text-align: center;
}

th.left {
text-align: center;
}

th.center {
text-align: center;
}

td.right {
text-align: right;
}

td.left {
text-align: left;
}

td.center {
text-align: center;
}

dt {
font-weight: bold;
}

.footpara:nth-child(2) {
display: inline;
}

.footpara {
display: block;
}

.footdef {
margin-bottom: 1em;
}

.figure {
padding: 1em;
}

.figure p {
text-align: center;
}

.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}

#org-div-home-and-up {
text-align: right;
font-size: 70%;
white-space: nowrap;
}

textarea {
overflow-x: auto;
}

.linenr {
font-size: smaller
}

.code-highlighted {
background-color: #ffff00;
}

.org-info-js_info-navigation {
border-style: none;
}

#org-info-js_console-label {
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}

.org-info-js_search-highlight {
background-color: #ffff00;
color: #000000;
font-weight: bold;
}


/*]]>*/-->






html css






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 5 at 5:51









Adriano

1,17911123




1,17911123










asked Nov 5 at 3:05









smilingbuddha

5,3992182139




5,3992182139








  • 2




    Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
    – Adriano
    Nov 5 at 3:09












  • It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
    – Jon P
    Nov 5 at 3:27












  • @smilingbuddha, if you could provide the HTML code it would very helpful.
    – Adriano
    Nov 5 at 3:34










  • Underlining of links has been the default since the 90s. Good to see you've caught up.
    – Rob
    Nov 5 at 3:49










  • Possible duplicate of How to remove the underline for anchors(links)?
    – Welcome to Stack Overflow
    Nov 5 at 4:01














  • 2




    Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
    – Adriano
    Nov 5 at 3:09












  • It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
    – Jon P
    Nov 5 at 3:27












  • @smilingbuddha, if you could provide the HTML code it would very helpful.
    – Adriano
    Nov 5 at 3:34










  • Underlining of links has been the default since the 90s. Good to see you've caught up.
    – Rob
    Nov 5 at 3:49










  • Possible duplicate of How to remove the underline for anchors(links)?
    – Welcome to Stack Overflow
    Nov 5 at 4:01








2




2




Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
– Adriano
Nov 5 at 3:09






Would you be able to show us the html markup relative to the anchor element? I have the suspect the underline is due to a border-bottom rather than a text-decoration
– Adriano
Nov 5 at 3:09














It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
– Jon P
Nov 5 at 3:27






It is very had to solve the problem if we don't have enough information to replicate the issue. A Minimal, Complete, and Verifiable example would be helpful. The code you have provided works : jsfiddle.net/ey6zfu1b . You could also use the browser developer tools (F12) to inspect the element to see where applied styles are coming from.
– Jon P
Nov 5 at 3:27














@smilingbuddha, if you could provide the HTML code it would very helpful.
– Adriano
Nov 5 at 3:34




@smilingbuddha, if you could provide the HTML code it would very helpful.
– Adriano
Nov 5 at 3:34












Underlining of links has been the default since the 90s. Good to see you've caught up.
– Rob
Nov 5 at 3:49




Underlining of links has been the default since the 90s. Good to see you've caught up.
– Rob
Nov 5 at 3:49












Possible duplicate of How to remove the underline for anchors(links)?
– Welcome to Stack Overflow
Nov 5 at 4:01




Possible duplicate of How to remove the underline for anchors(links)?
– Welcome to Stack Overflow
Nov 5 at 4:01












3 Answers
3






active

oldest

votes

















up vote
1
down vote













In your edit, note .underline { text-decoration: underline; } , a class has been explicitly created and assigned to underline text. I would expect this is where your underline is coming from.



My preference would be to remove that class from any link elements with a class of underline.



Alternatively create a more specific selector



a.underline {text-decoration:none;}


which is better than using !important : https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/






share|improve this answer




























    up vote
    -1
    down vote













    It's clearly some CSS is overriding your CSS. Pink isn't the default color of links. Try using !important to your styles. e.g text-decoration: none !important;






    share|improve this answer





















    • You are probably right. Please see edit.
      – smilingbuddha
      Nov 5 at 3:31


















    up vote
    -1
    down vote













    There could be various reasons of why the styling in your web page behaves in such way.




    1. The order of precedence rule, in which the browser will favor first the embedded styles then the link tag and lastly the style tag.
      Perhaps you have embedded styles within that specific links, or you're using an external css file which overrides the styles contained within the style tag



    2. The rules of cascading defined by the w3 in which it states that more specific rules override more general ones, perhaps you are making use of an external css file which contains an specific rule like the next one that overrides the styling rules inside the style tag



      p > a {
      text-decoration: underline;
      color: pink
      }




    but if you want an easy way to make all the links behave the way you intent them to you can use the !important rule beside the styling rule you want to override the rest



    text-decoration: underline !important;






    share|improve this answer










    New contributor




    Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














       

      draft saved


      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147794%2fhow-to-globally-avoid-underlining-links-in-an-html-page%23new-answer', 'question_page');
      }
      );

      Post as a guest
































      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      In your edit, note .underline { text-decoration: underline; } , a class has been explicitly created and assigned to underline text. I would expect this is where your underline is coming from.



      My preference would be to remove that class from any link elements with a class of underline.



      Alternatively create a more specific selector



      a.underline {text-decoration:none;}


      which is better than using !important : https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/






      share|improve this answer

























        up vote
        1
        down vote













        In your edit, note .underline { text-decoration: underline; } , a class has been explicitly created and assigned to underline text. I would expect this is where your underline is coming from.



        My preference would be to remove that class from any link elements with a class of underline.



        Alternatively create a more specific selector



        a.underline {text-decoration:none;}


        which is better than using !important : https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/






        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          In your edit, note .underline { text-decoration: underline; } , a class has been explicitly created and assigned to underline text. I would expect this is where your underline is coming from.



          My preference would be to remove that class from any link elements with a class of underline.



          Alternatively create a more specific selector



          a.underline {text-decoration:none;}


          which is better than using !important : https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/






          share|improve this answer












          In your edit, note .underline { text-decoration: underline; } , a class has been explicitly created and assigned to underline text. I would expect this is where your underline is coming from.



          My preference would be to remove that class from any link elements with a class of underline.



          Alternatively create a more specific selector



          a.underline {text-decoration:none;}


          which is better than using !important : https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 5 at 3:40









          Jon P

          11.4k73458




          11.4k73458
























              up vote
              -1
              down vote













              It's clearly some CSS is overriding your CSS. Pink isn't the default color of links. Try using !important to your styles. e.g text-decoration: none !important;






              share|improve this answer





















              • You are probably right. Please see edit.
                – smilingbuddha
                Nov 5 at 3:31















              up vote
              -1
              down vote













              It's clearly some CSS is overriding your CSS. Pink isn't the default color of links. Try using !important to your styles. e.g text-decoration: none !important;






              share|improve this answer





















              • You are probably right. Please see edit.
                – smilingbuddha
                Nov 5 at 3:31













              up vote
              -1
              down vote










              up vote
              -1
              down vote









              It's clearly some CSS is overriding your CSS. Pink isn't the default color of links. Try using !important to your styles. e.g text-decoration: none !important;






              share|improve this answer












              It's clearly some CSS is overriding your CSS. Pink isn't the default color of links. Try using !important to your styles. e.g text-decoration: none !important;







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 5 at 3:20









              ACD

              28110




              28110












              • You are probably right. Please see edit.
                – smilingbuddha
                Nov 5 at 3:31


















              • You are probably right. Please see edit.
                – smilingbuddha
                Nov 5 at 3:31
















              You are probably right. Please see edit.
              – smilingbuddha
              Nov 5 at 3:31




              You are probably right. Please see edit.
              – smilingbuddha
              Nov 5 at 3:31










              up vote
              -1
              down vote













              There could be various reasons of why the styling in your web page behaves in such way.




              1. The order of precedence rule, in which the browser will favor first the embedded styles then the link tag and lastly the style tag.
                Perhaps you have embedded styles within that specific links, or you're using an external css file which overrides the styles contained within the style tag



              2. The rules of cascading defined by the w3 in which it states that more specific rules override more general ones, perhaps you are making use of an external css file which contains an specific rule like the next one that overrides the styling rules inside the style tag



                p > a {
                text-decoration: underline;
                color: pink
                }




              but if you want an easy way to make all the links behave the way you intent them to you can use the !important rule beside the styling rule you want to override the rest



              text-decoration: underline !important;






              share|improve this answer










              New contributor




              Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                up vote
                -1
                down vote













                There could be various reasons of why the styling in your web page behaves in such way.




                1. The order of precedence rule, in which the browser will favor first the embedded styles then the link tag and lastly the style tag.
                  Perhaps you have embedded styles within that specific links, or you're using an external css file which overrides the styles contained within the style tag



                2. The rules of cascading defined by the w3 in which it states that more specific rules override more general ones, perhaps you are making use of an external css file which contains an specific rule like the next one that overrides the styling rules inside the style tag



                  p > a {
                  text-decoration: underline;
                  color: pink
                  }




                but if you want an easy way to make all the links behave the way you intent them to you can use the !important rule beside the styling rule you want to override the rest



                text-decoration: underline !important;






                share|improve this answer










                New contributor




                Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




















                  up vote
                  -1
                  down vote










                  up vote
                  -1
                  down vote









                  There could be various reasons of why the styling in your web page behaves in such way.




                  1. The order of precedence rule, in which the browser will favor first the embedded styles then the link tag and lastly the style tag.
                    Perhaps you have embedded styles within that specific links, or you're using an external css file which overrides the styles contained within the style tag



                  2. The rules of cascading defined by the w3 in which it states that more specific rules override more general ones, perhaps you are making use of an external css file which contains an specific rule like the next one that overrides the styling rules inside the style tag



                    p > a {
                    text-decoration: underline;
                    color: pink
                    }




                  but if you want an easy way to make all the links behave the way you intent them to you can use the !important rule beside the styling rule you want to override the rest



                  text-decoration: underline !important;






                  share|improve this answer










                  New contributor




                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  There could be various reasons of why the styling in your web page behaves in such way.




                  1. The order of precedence rule, in which the browser will favor first the embedded styles then the link tag and lastly the style tag.
                    Perhaps you have embedded styles within that specific links, or you're using an external css file which overrides the styles contained within the style tag



                  2. The rules of cascading defined by the w3 in which it states that more specific rules override more general ones, perhaps you are making use of an external css file which contains an specific rule like the next one that overrides the styling rules inside the style tag



                    p > a {
                    text-decoration: underline;
                    color: pink
                    }




                  but if you want an easy way to make all the links behave the way you intent them to you can use the !important rule beside the styling rule you want to override the rest



                  text-decoration: underline !important;







                  share|improve this answer










                  New contributor




                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer








                  edited Nov 5 at 17:43





















                  New contributor




                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Nov 5 at 3:44









                  Brian Jerez

                  12




                  12




                  New contributor




                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Brian Jerez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147794%2fhow-to-globally-avoid-underlining-links-in-an-html-page%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest




















































































                      這個網誌中的熱門文章

                      Xamarin.form Move up view when keyboard appear

                      Post-Redirect-Get with Spring WebFlux and Thymeleaf

                      Anylogic : not able to use stopDelay()