Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #21259
Closed
Open
Issue created Nov 30, 2016 by Administrator@rootContributor

Inline `code` tags inside of `a` tags aren't formatted properly

Created by: impressivewebs

There are rare instances where someone might be writing about code and wrapping terms in HTML's <code> tags. Sometimes these are also hyperlinked. When this happens with Bootstrap, the default styles for the code tag overpower the styles for the link, so you can't actually tell that it's a link.

You can see examples in this CodePen demo, in the second paragraph. Notice the two portions of that paragraph inside <code> tags. Both are links. The styling on the <code> portion makes the link appear like two links. Also, the 2nd link doesn't look like a link at all, because only the <code> portion is inside the link. Also, when you hover over the links, the styling looks wrong.

This happens in Bootstrap 3 and 4. Here's a demo using Bootstrap 3

An easy fix for this is to add the following:

a code {
  color: inherit;
  background: inherit;
  padding: inherit;
}

Here is a corrected version with Bootstrap 4 and here is Bootstrap 3 corrected.

You could also do all: inherit but I'm not sure if browser support for the all property is good. FWIW, most code bases have this problem, including ZURB's Foundation (I'll file an issue with them too).

Assignee
Assign to
Time tracking