Open In App

Primer CSS Nested Link

Last Updated : 24 Apr, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

In this article, we will learn about Primer CSS Nested Links. Primer CSS Nested Links are used only when a part of the link is to be styled.

Primer CSS Nested Link class used:

  • Link: This class is used to style only one part of the link. They are nested inside an <a> element on the part which is to be styled. It makes that part appear blue.

Syntax:

<a class="color-fg-default no-underline" href="#">
      ... <span class="Link">...</span>
</a>

Example 1: Below example demonstrates the use of Primer CSS Nested Link.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Primer CSS Nested Links</title>
    <link rel="stylesheet" href=
</head>
  
<body>
    <h1 style="color:green">GeeksforGeeks</h1>
    <h3>Primer CSS Nested Links</h3>
    <h2
      <a class="no-underline" href="#url" 
        style="color: black;">
        A nested <span class="Link">Link</span>
      </a>
    </h2>
</body>
  
</html>


Output:

Primer CSS Nested Link

Example 2: This example shows, that we can also use nested links with heading tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Primer CSS Nested Links</title>
    <link rel="stylesheet" href=
</head>
  
<body>
    <h1 style="color:green">GeeksforGeeks</h1>
    <h3>Primer CSS Nested Links</h3>
    <h2
      <a class="no-underline" href="#" 
        style="color: black;">
        A nested Link<h2 class="Link">GeeksforGeeks</h2>
      </a>
    </h2>
</body>
  
</html>


Output:

Primer CSS Nested Link

Reference: https://primer.style/css/components/links#nested-link



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads