Link - 图1

Link

Link element is used to call app actions and for navigation between pages (routes)

Link Layout

  1. <a class="link" href="path/to/somewhere">Link Text</a>

If you use link with icon and text, then the following layout is recommended:

  1. <a class="link" href="path/to/somewhere">
  2. <i class="icon"></i>
  3. <span>Link Text</span>
  4. </a>

If you use link with icon only, then:

  1. <a class="link icon-only" href="path/to/somewhere">
  2. <i class="icon"></i>
  3. </a>

Bypass Links Handler

It is possible to bypass F7 link handler (if you want to add custom logic to link, or want it to direct to external website). In this case we need additional external class:

  1. <a class="link external" href="http://google.com">Open Google</a>

CSS Variables

Below is the list of related CSS variables (CSS custom properties).

  1. :root {
  2. --f7-link-highlight-black: rgba(0, 0, 0, 0.1);
  3. --f7-link-highlight-white: rgba(255, 255, 255, 0.15);
  4. --f7-link-highlight-color: var(--f7-link-highlight-black);
  5. }
  6. .theme-dark {
  7. --f7-link-highlight-color: var(--f7-link-highlight-white);
  8. }