Beautiful css link styles

Содержание
  1. CSS Links
  2. Text Decoration
  3. Example of using the text-decoration property to style a link:
  4. Let’s explain the meaning of our code.
  5. Color
  6. Example of using the color property to style a link:
  7. Result
  8. Background Color
  9. Example of using the background-color property to style a link:
  10. Practice Your Knowledge
  11. a:active is a link
  12. 56 CSS Link Hover Effects
  13. Related Articles
  14. Author
  15. Links
  16. Made with
  17. About a code
  18. Custom Animated Links with Psuedo Elements
  19. Author
  20. Links
  21. Made with
  22. About a code
  23. Hover Effect #4
  24. Author
  25. Links
  26. Made with
  27. About a code
  28. Hover Effect #5
  29. Author
  30. Links
  31. Made with
  32. About a code
  33. Hover Effect #6
  34. Author
  35. Links
  36. Made with
  37. About a code
  38. Hover Effect #7
  39. Author
  40. Links
  41. Made with
  42. About a code
  43. Hover Effect #1
  44. Author
  45. Links
  46. Made with
  47. About a code
  48. Hover Effect #2
  49. Author
  50. Links
  51. Made with
  52. About a code
  53. Mouse-Out Hover Effect
  54. Author
  55. Links
  56. Made with
  57. About a code
  58. Link Split Hover Effect
  59. Author
  60. Links
  61. Made with
  62. About a code
  63. Exploring Creative Link Hover Effects
  64. Author
  65. Links
  66. Made with
  67. About a code
  68. Fade out Other Links on Hover
  69. Author
  70. Links
  71. Made with
  72. About a code
  73. Laser Revealed Title Link
  74. Author
  75. Links
  76. Made with
  77. About a code
  78. Displaying Link URLs
  79. Author
  80. Links
  81. Made with
  82. About a code
  83. Neat Hover Effects
  84. Author
  85. Links
  86. Made with
  87. About a code
  88. Simple CSS Line Hover Animations for Links
  89. Author
  90. Links
  91. Made with
  92. About a code
  93. CSS Link Hover Animation
  94. Author
  95. Links
  96. Made with
  97. About a code
  98. Animated SVG Links
  99. Author
  100. Links
  101. Made with
  102. About a code
  103. Link Hover Animation
  104. Author
  105. Links
  106. Made with
  107. About a code
  108. Variable Powered Underline Transition
  109. Author
  110. Links
  111. Made with
  112. About a code
  113. Underline Animation — Link
  114. Author
  115. Links
  116. Made with
  117. About a code
  118. Link Hover Interaction
  119. Author
  120. Links
  121. Made with
  122. About a code
  123. Link Hover Flash
  124. Author
  125. Links
  126. Made with
  127. About a code
  128. Underline Animation
  129. Author
  130. Links
  131. Made with
  132. About a code
  133. Link Fill on Hover
  134. Author
  135. Links
  136. Made with
  137. About a code
  138. Underline Link Effect
  139. Author
  140. Links
  141. Made with
  142. About a code
  143. Half-transparent CurrentColor Link Underline
  144. Author
  145. Links
  146. Made with
  147. About a code
  148. Spring/Bounce Hover Effect
  149. Author
  150. Links
  151. Made with
  152. About the code
  153. Link Styling
  154. Author
  155. Links
  156. Made with
  157. About the code
  158. Flag # links!
  159. Author
  160. Links
  161. Made with
  162. About the code
  163. Link Effect
  164. Author
  165. Links
  166. Made with
  167. About the code
  168. Link with Gradient Background
  169. Author
  170. Links
  171. Made with
  172. About the code
  173. Animated Font Weight On Hover
  174. Author
  175. Links
  176. Made with
  177. About the code
  178. Multi-line Link
  179. Author
  180. Links
  181. Made with
  182. About the code
  183. Link Arrow
  184. Author
  185. Links
  186. Made with
  187. About the code
  188. Gradient Underline Animation
  189. Author
  190. Links
  191. Made with
  192. About the code
  193. Cool Hover Effect With mix-blend-mode
  194. Underline Hover
  195. Animate Underline Wavy
  196. Fancy Text-Shadow Link Underline
  197. Follow Along Links
  198. Pure CSS Single Element Link Styles
  199. Strikethrough Hover Effect
  200. Jumping Link Hovers
  201. Arrowed Link
  202. Author
  203. CSS Links
  204. Styling Links
  205. Example
  206. Example
  207. Text Decoration
  208. Example
  209. Background Color
  210. Example
  211. Link Buttons
  212. Example
  213. More Examples
  214. Example
  215. Example
  216. Example
  217. COLOR PICKER
  218. Report Error
  219. Thank You For Helping Us!
Читайте также:  Php string all digits

In this chapter, we will explain how we can give styles to links, how to make links more beautiful.

The link has these four states:

  • a :link — a normal, unvisited link
  • a :visited — a link that the user has already visited
  • a :hover — a link when the user hovers over it
  • a :active — a link at the moment when it is clicked

We will speak about these properties:

Text Decoration

As you remember when we create a link, by default it is underlined. When we want to remove it we must use text-decoration property.

Example of using the text-decoration property to style a link:

html> html> head> title>Title of the document title> style> a:link < text-decoration: none; > a:visited < text-decoration: none; > a:hover < text-decoration: underline; > a:active < text-decoration: underline; > style> head> body> a href="#"> This is some link. a> body> html>

Let’s explain the meaning of our code.

Here you can see that our link in its first and second state will be without underline. The link is underlined when the user mouses over it and when a link is clicked in the moment.

You can check it in your browsers with your editors or with our online editor click here and go to the page of the editor.

Color

The color property we use for the color of the link.

For example when we want our link to be black and to be #1c87c9 in its 3rd state (a: hover) we need to write the following:

Example of using the color property to style a link:

html> html> head> title>Title of the document title> style> a:link < color: #000000; > a:visited < color: #000000; > a:hover < color: #1c87c9; > a:active < color: #1c87c9; > style> head> body> a href="#">This is some link. a> body> html>

Result

Color Property

Background Color

What can we do if we want our link to be with a background?

We just need to give a style with background-color property.

For example, our link will be with a gray background, and in the hover, it will be #1c87c9.

When the first (a:link) and the second (a:visited) states have the same background color we can write just a.

Example of using the background-color property to style a link:

html> html> head> title>Title of the document title> style> a < background-color: #555555; > a:hover < background-color: #1c87c9; > a:active < background-color: #1c87c9; > style> head> body> a href="#">This is some link. a> body> html>

You can choose your preferable color with the Color Picker.

Practice Your Knowledge

that the user has already visited that is not visited when the user mouses over it the moment it is clicked

Источник

Collection of hand-picked free HTML and CSS link effect code examples from Codepen, GitHub, and other resources with :hover and :active state. Update of May 2021 collection. Twelve new items.

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #4

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #5

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #6

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #7

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #1

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Hover Effect #2

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Mouse-Out Hover Effect

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

The text is duplicated, masked with clip-path then psuedoelements and movements are animated with CSS transitions. The underscore is made with a linear gradient background image, but if you don’t plan to use a link like this over multiple lines of text, you could just use another pseudoelement.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Laser Revealed Title Link

Author

Made with

About a code

How to display the href attribute of a link next to the link text.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Neat Hover Effects

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

A couple of simple & subtle CSS-based line hover animations for links.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Variable Powered Underline Transition

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Underline Animation

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Link hover effects that fill a link with an underline or line-through using CSS transitions and the clip-path property.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Animated underline/border link effect. Edit transform-origin to change how where the animation starts. It’s currently set to left.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Half-transparent CurrentColor Link Underline

Author

Made with

About a code

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About a code

Spring/Bounce Hover Effect

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Link Styling

Author

Made with

About the code

Link styling exploration without classes.

Compatible browsers: Chrome, Firefox, Opera, Safari

Demo image: Flag # links!

Author

Made with

About the code

Broken link styles. Flag # links with CSS! Never forget a href=»#» placeholder again!

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About the code

HTML and CSS link squiggle effect.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About the code

Link with gradient background on hover.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About the code

Animated Font Weight On Hover

Author

Made with

About the code

Multi-line link hover effect.

Demo image: Link Arrow

Author

Made with

About the code

Author

Made with

About the code

Gradient Underline Animation

Using a css background gradient and css animation this allows the animation of a link underline to carry across multiple lines. This previously would be achieved using the :pseudo elements. However doing this over multiple lines proved tricky.

Author

Made with

About the code

Cool Hover Effect With mix-blend-mode

This is cool because you don’t need to change the color of the link on :hover . The mix-blend-mode in the ::after will invert it for you.

Underline Hover

HTML and CSS underline hover effect.
Made by Elwin van den Hazel
July 12, 2017

Demo Image: Animate underline Wavy

Animate Underline Wavy

That cool wiggly underline that people like.
Made by David Darnes
July 10, 2017

Demo Image: Fancy Text-Shadow Link Underline

HTML and CSS fancy text-shadow link underline.
Made by Ryan
July 1, 2017

Hover on the links and it follows the cursor, highlighting the links as you go!
Made by Katherine Kato
June 23, 2017

Inspired by things that have seen from Medium and other peoples pens but with an added attempt at bringing in some animation. Currently limited to a link that is in total 10000px wide across all lines.
Made by Matthew Shields
June 24, 2017

Demo Image: Strikethrough Hover Effect

Strikethrough Hover Effect

Hover effect for links. Use only one pseudo-element on link.
Made by Artyom
June 23, 2017

Jumping link hovers with HTML and CSS.
Made by Bennett Feely
June 19, 2017

Arrowed link — circle on hover (cf Google home website).
Made by Alexandre Jolly
May 21, 2017

Author

Источник

With CSS, links can be styled in many different ways.

Links can be styled with any CSS property (e.g. color , font-family , background , etc.).

Example

In addition, links can be styled differently depending on what state they are in.

The four links states are:

  • a:link — a normal, unvisited link
  • a:visited — a link the user has visited
  • a:hover — a link when the user mouses over it
  • a:active — a link the moment it is clicked

Example

/* unvisited link */
a:link color: red;
>

/* visited link */
a:visited color: green;
>

/* mouse over link */
a:hover color: hotpink;
>

/* selected link */
a:active color: blue;
>

When setting the style for several link states, there are some order rules:

Text Decoration

The text-decoration property is mostly used to remove underlines from links:

Example

a:visited text-decoration: none;
>

a:hover text-decoration: underline;
>

a:active text-decoration: underline;
>

Background Color

The background-color property can be used to specify a background color for links:

Example

a:link <
background-color: yellow;
>

a:visited background-color: cyan;
>

a:hover background-color: lightgreen;
>

a:active background-color: hotpink;
>

This example demonstrates a more advanced example where we combine several CSS properties to display links as boxes/buttons:

Example

a:link, a:visited <
background-color: #f44336;
color: white;
padding: 14px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
>

a:hover, a:active background-color: red;
>

More Examples

Example

This example demonstrates how to add other styles to hyperlinks:

Example

Another example of how to create link boxes/buttons:

a:link, a:visited <
background-color: white;
color: black;
border: 2px solid green;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
>

a:hover, a:active background-color: green;
color: white;
>

Example

This example demonstrates the different types of cursors (can be useful for links):

Unlock Full Access 50% off

COLOR PICKER

colorpicker

Join our Bootcamp!

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

Thank You For Helping Us!

Your message has been sent to W3Schools.

Top Tutorials
Top References
Top Examples
Get Certified

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Источник

Оцените статью