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:
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;
}
/*]]>*/-->
html css
|
show 2 more comments
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:
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;
}
/*]]>*/-->
html css
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 aborder-bottom
rather than atext-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
|
show 2 more comments
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:
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;
}
/*]]>*/-->
html css
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:
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
html css
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 aborder-bottom
rather than atext-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
|
show 2 more comments
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 aborder-bottom
rather than atext-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
|
show 2 more comments
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/
add a comment |
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;
You are probably right. Please see edit.
– smilingbuddha
Nov 5 at 3:31
add a comment |
up vote
-1
down vote
There could be various reasons of why the styling in your web page behaves in such way.
The order of precedence rule, in which the browser will favor first the embedded styles then the link
tag
and lastly thestyle
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
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;
New contributor
add a comment |
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/
add a comment |
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/
add a comment |
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/
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/
answered Nov 5 at 3:40
Jon P
11.4k73458
11.4k73458
add a comment |
add a comment |
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;
You are probably right. Please see edit.
– smilingbuddha
Nov 5 at 3:31
add a comment |
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;
You are probably right. Please see edit.
– smilingbuddha
Nov 5 at 3:31
add a comment |
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;
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;
answered Nov 5 at 3:20
ACD
28110
28110
You are probably right. Please see edit.
– smilingbuddha
Nov 5 at 3:31
add a comment |
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
add a comment |
up vote
-1
down vote
There could be various reasons of why the styling in your web page behaves in such way.
The order of precedence rule, in which the browser will favor first the embedded styles then the link
tag
and lastly thestyle
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
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;
New contributor
add a comment |
up vote
-1
down vote
There could be various reasons of why the styling in your web page behaves in such way.
The order of precedence rule, in which the browser will favor first the embedded styles then the link
tag
and lastly thestyle
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
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;
New contributor
add a comment |
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.
The order of precedence rule, in which the browser will favor first the embedded styles then the link
tag
and lastly thestyle
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
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;
New contributor
There could be various reasons of why the styling in your web page behaves in such way.
The order of precedence rule, in which the browser will favor first the embedded styles then the link
tag
and lastly thestyle
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
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;
New contributor
edited Nov 5 at 17:43
New contributor
answered Nov 5 at 3:44
Brian Jerez
12
12
New contributor
New contributor
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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 atext-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