Remove Caption in Hoverover pop up

Things I have tried

My css code as it is right now:

.popover.hover-popover {
position: absolute;
z-index: var(–layer-popover);
max-height:50vh;
min-height:20vh;
width:50vh;
overflow:hidden;
padding:0;
}

.popover.hover-popover .markdown-embed {
height:50vh;
font-size: 0.85em;
line-height:1.4;
margin-top:-30px;
}

What I’m trying to do

I would like to remove the caption of the previewed note in the pop up because it takes up a big part of the screen (see image). I dont want the pop up to be empty in that place but i want the note to be moved up.

Thank you for your help! :slight_smile:

EDIT: FINAL SOLUTION

Here is a very targeted solution for your pop-up:

div.popover.hover-popover.is-loaded > div > div.markdown-embed-content.markdown-embed-page > div > div > div:nth-child(2) > :is(h1, h2, h3, h4, h5, h6) {
    display: none;
} 

**

OLD POST (disregard):

1 - This will hide the first line of every ‘popup preview’:

.markdown-preview-section > div:nth-child(2) {
    display: none;
}

of course, some notes may not have a header, so…

**

2 - You can make it better by specifying the class of that Header title (Faraday’s…) after div:nth-child(2).

For example, if that Header title is top-level (h1), here is your snippet:

.markdown-preview-section > div:nth-child(2) > h1 {
    display: none;
}

^ That will hide the first line - only when it’s a big fat header.

**

[NOTE: This is based on using the default theme]

Thank you for your reply. The two solutions that you provided hide the header in the hover over popup. However, they also hide it in general, if the note is opened normally (in preview mode). I was searching for a method that only hides the headline in the link hover over pop up

Here is a very targeted solution for your pop-up:

div.popover.hover-popover.is-loaded > div > div.markdown-embed-content.markdown-embed-page > div > div > div:nth-child(2) > :is(h1, h2, h3, h4, h5, h6) {
    display: none;
}

Blessings to you,

:dove:

1 Like

works! Thank you so much for the help!! :slight_smile:

1 Like

@ZenMoto , Might I ask how you got to see the CSS/source of the popup window? I’m trying various option using developer tools, but I can’t grab the popup window for source viewing.

Yeah, you’re right, it’s a little tricky.

  1. Get the popup to appear, then hover the mouse directly on the popup text (so that the arrow becomes a text-cursor)

  2. Open DevTools with a hotkey - CMD+OPT+I (on Mac) or F12 (on Windows)

  3. "popover hover-popover is-loaded" is the last div in body

NOTE: You want that DevTools window to load directly ON the popup (because if you hover elsewhere in the Obsidian window, the popup will vanish from the DOM).

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.