Now I want to add another class to style links that point to DEVONthink records but can’t figure out how. Some time ago I’ve read that when adding additional link elements the order in the CSS file is important, unfortunately I don’t find the page anymore.
Is it possible to style link or e.g. hr in custom classes?
And does DEVONthink respect a:visited? Could’t make that work too.
BTW, what you posted as searchResultHit is an element selector, it would style something like ´Result. A class selector starts with a dot. There’s more on link styling at MDN. This is also a very good source for all questions related to CSS, HTML and JavaScript Edit: I just noticed that you don’t even need a class for DT links. Instead, you could use an attribute selector in the CSS like so
supposing that the link contains the string x-devonthink.
May I suggest that you abstain from using absolute dimensions in font styling (and possible all other aspects, too)? font-size: 1em would just use the default setting in the current user agent, which can usually be influenced by the user. Using relative units (like em et al) ensures that the document displays nicely on a lot of devices and works well with fluid layouts.
Searched again, this time reading slowly and it’s simply not possible to style a link in markdown syntax, one has to use HTML syntax.
Didn’t check again but it didn’t work with a dot (probably because that would need another syntax in the markdown file?). Do I run in any trouble if I use it the way I do it now?
Also any idea why I can’t make use of styling a:visited?
Hi, there’s some mismatch of terminology here. <bla>something</bla>
is pure HTML: You’re defining a pseudo-element here. Which works together with an element selector in your CSS
bla {
color: red;
}
There’s no class here: A class in the CSS sense is denoted by a class attribute in a HTML element like so: <bla class="foo">something</bla>.
Since this is all a bit off-topic here, I’ll not elaborate more. If you’re interested, just send me a PM.
One possible reason: browsers tend to ignore :visited for privacy reasons: A website could determine which links on it you have visited by checking the style attribute. Another one might be the fact that “visited” might not make much sense in a MD file.
Follow-up question: Is it possible to change a link’s color with embedded CSS relative to the CSS a user might have set in a CSS file?
I’ve go text that only contains of links (so without CSS everything is blue and underlined ) and want these links to look like they were normal text. But I don’t know what CSS a user might use or if there’s CSS used at all.
If possible the user’s CSS should not be changed except link color and underlining.
Captures are showing the desired results (body{background-color:#1e1e1e; color:#f4f4f4;} is only an example of a user’s CSS).
Also, though not shouldn’t be habitually used, you can force an override for an attribute by adding the !important term after the value and before the semi-colon.
I have a script that outputs markdown source similar to the ones in the pictures.
I’d like to style this accordingly to users’ CSS, my goal is to make links look like normal text but
I don’t know what CSS users use
whether they use CSS at all
whether they use dark or light mode
I know I could overwrite background and text color in order to make sure that my styled links would be properly readable in any case - however if it’s possible I’d like to respect the user’s CSS and only change the link color to make it readable in the user’s CSS environment.
The documentation says that inherit lets the element inherit the calculcated style of the its parent element. Since the links are probably part of a p element (hopefully), inherit should apply that paragraph’s foreground and background color to the link and remove the underline.