Underline long url

how to cite a hyperlink in apa
hyperlink citation example
how to write a url in an essay
how to break a url in apa format
do you include the link in apa citation
how to cite a link in apa format
do you need to cite a hyperlink
how to write a web address

On mobile devices with a width < 400px underlined links with long text breaks in two lines and just the second line will be underline.

How can i solve this problem.

CSS code:

a {
    position: relative;
    display: inline-block;  
    cursor: pointer;
    color: #1a1a1a;
    text-decoration: none;
}

a:after {
    position: absolute;
    content: "";
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: calc(100% - 5px);
    min-height: 2px;
    height: .15em;
    background: #1a1a1a;
    transition: all .15s cubic-bezier(.25,.46,.45,.94);
} 

a:hover:after {
    width: 105%; 
}

With this you have removed the text underline

text-decoration: none;

And then you replace it with a line in a a:after, this is how this is expected to work and if you want to revert it remove the text-decoration and a:after block.

Underline long url, With this you have removed the text underline text-decoration: none;. And then you replace it with a line in a a:after, this is how this is expected  In my dissertation I have a long URL containing many underscore characters as word separators (Wiki software did this). These URLs break at an underscore (good!), but too late, causing the line of text to extend into the margin. There is an earlier underscore, but the break doesn't happen there.

It is because you converted <a> to inline block element. just remove that display: inline-block; applied to <a> and it will work.

By default <a> tags are inline elements. So there is no need of applying display: inline-block for . But in case from some where <a> tag is inheriting some other display properties, the you have to apply/overwrite display: inline to your <a> element.

APA Style 6th Edition Blog: URLs, Thus, we remove the underlining from the link and set the font color to than 1 minute long, include a zero in the minutes column (e.g., 0:32). When a DOI or URL is long or complex, you may use shortDOIs or shortened URLs if desired. Use the shortDOI service provided by the International DOI Foundation to create shortDOIs. A work can have only one DOI and only one shortDOI; the shortDOI service will either produce a new shortDOI for a work that has never had one or retrieve an existing shortDOI.

Allthough I would recommend using the text-decoration property as mentioned in previous answers, you may wrap the links content in an inline element and apply some margin/padding to use the border bottom property. Then you may animate the underline in one or more lines.

div {
  width: 210px;
}

a {
  position: relative;
  display: inline-block;
  cursor: pointer;
  color: #1a1a1a;
  text-decoration: none;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
  margin-bottom: 20px;
}

span {
  box-sizing: content-box;
  position: relative;
  left: 0;
  border-bottom: 3px solid #1a1a1a;
  transition: all .15s cubic-bezier(.25, .46, .45, .94);
}

a:hover span {
  margin: 0 -10px;
  padding: 0 10px;
  border-bottom-color: navy;
}
<div>
  <a href="#"><span>Short link</span></a>

  <a href="#"><span>Really long link text here that breaks into 2 lines</span></a>
</div>

How to Format URLs in Text, I know it's possible to make links any style you want if you fiddle with the code, but underlining is the default style, so if you underline text, some  Indeed, when URLs are so long that they become unreadable, truncating them will be necessary. (Omitting the URL altogether, however, may not make it clear that the source you are citing appears online.) The question is, How long is too long? If the URL compromises the readability of your entry, then it is too long.

Links and Hypertext - Link Text and Appearance, For practical purposes, the link needs to be long enough to convey the purpose of the link and no longer. Content Web addresses, or URLs, present two types of challenges: Browsers underline hypertext links by default. This is a pretty damned lazy question, even ignoring the fact that you called it a "long underline". – John Saunders Mar 20 '13 at 5:55 I felt as if it was a bit of a nooby question, and it i just forgot something, that required a 30 second answer.

URLs: Some Practical Advice, Indeed, when URLs are so long that they become unreadable, truncating them will be necessary. The length of the entry is one factor: if a URL is several lines longer than the rest of Am I supposed to underline the URL? Then you can give the filter an an id and reference it in CSS with something like filter: url(‘#svg-underline’). The advantage here is that the filter adds transparency without relying on text-shadow .

Styling Links with Real Underlines, Or you could keep this long-established visual affordance. But if we're going to use underlines, we want them to look nice. Marcin Wichary, a  Most users browsing the Internet understand the concept of links being underlined, and may not expect that to change. These users may assume any text not underlined is not a link. For this reason, if you remove the underline, make sure to change the link color to something different than all other text, so it stands out clearly to the user.

Comments
  • Um, text-decoration: underline instead of that :after thing? Or if you did that only to control the height of the underline, use border-bottom.
  • I thought so, too. But the real problem is, that he rolls his own underlining implementation with the :after selector.
  • it didn't help.
  • As @Boldewyn mentioned, if you are trying for a custom underline, my answer will not work. But if you are okay to use with default text underline, it will work. Please let me know if you want a sample.