its only applying to odds titles in table, i want style all the titles
Assistant
The code you wrote targets all <th> elements, so it should apply the background color to all table headers. If it's only applying to odd headers, there might be other CSS rules interfering or some CSS specificity issues.
Here are some suggestions to make sure the style applies to all<th> cells in your tables:
Add a semicolon at the end
CSS properties should end with a semicolon. Sometimes missing semicolons cause unpredictable behavior.
css
th {
background-color: rgba(0, 0, 0, 0.05);
}
Increase specificity if other rules override yours
Try specifying the table in the selector to increase specificity:
User
Informações Adicionais
Exercício
Séries, Repetições, Tempo
PSE/RPE
Explosão
Terra
0/20/30/40/40/30/30/20/20
7
this is my table
Assistant
Thank you for sharing your table! This markdown table correctly uses the first row as the header, so Obsidian should render the first row cells as <th> elements.
Given your issue—background color only applying to odd headers—here are a couple of detailed troubleshooting steps and a robust CSS snippet:
1. Ensure proper CSS syntax
Make sure your CSS has the semicolon:
css
User
.callout-title {
font-style:italic;
font-size: 1.2em;
-webkit-text-stroke: 0.1px #F0E68C; /* Bege clássico /; / Red border around each letter */
#-webkit-text-stroke: 0.1px black; /* Bege clássico /; / Red border around each letter /
color: #a55757; / Text fill color */
font-weight: 900;
font-family: 'Amiri', sans-serif
}
add to it so that its all in uppercase
Assistant
To make all the text inside elements with the .callout-title class appear in uppercase, add the CSS property:
css
text-transform: uppercase;
Here's your updated CSS with that added, plus a couple of fixes (remove # comment markers which are invalid in CSS, use /* comment */ instead):
css
.callout-title {
/* font-style: italic; */
font-size: 1.2em;
/* -webkit-text-stroke: 0.1px #F0E68C; /* Bege clássico */ */
/* -webkit-text-stroke: 0.1px black; /* Red border around each letter */ */
color: #a55757; /* Text fill color */
font-weight: 900;
font-family: 'Amiri', sans-serif;
text-transform: uppercase;
}
Notes:
I assumed the commented-out lines starting with # were meant as comments. CSS comments use /* ... */, not #.
I left the text stroke lines commented out as you had them.
User
how can i add a space between paragraphs in obsidian when pressing only one enter
in other words i just a want a bigger gap between this regular lines and not the double line which would consider a really paragraph
Assistant
In Markdown (and Obsidian), a typically doesn't create a new paragraph — it just continues the same paragraph or creates a line break (depending on the renderer and settings). A is what creates a new paragraph with spacing.
User
i want the css for the line break and for both preview and editing mode
Check if the table header cells are really <th> elements
Sometimes Obsidian or markdown tables render headers as <td> instead of <th>. Try this to also target header-like cells:
/* Style all table headers in Obsidian */
/* For real <th> elements */
th {
background-color: rgba(0, 0, 0, 0.05) !important;
}
/* For first row cells rendered as <td> instead of <th> */
table tr:first-child td {
background-color: rgba(0, 0, 0, 0.05) !important;
}
Final tip:
Use the developer tools (Ctrl+Shift+I or Cmd+Option+I) in Obsidian to inspect your table cells to confirm whether they are <th> or <td> elements and see what CSS is applied or overridden.
If after this it still applies only to odd headers, please let me know what theme you're using or if any other custom CSS is active, so we can detect potential conflicts!
Added the text-transform: uppercase; as requested to convert text to uppercase.
Let me know if you want me to activate any commented-out lines!
single Enter (line break)
double Enter (empty line)
You want this behavior:
Single Enter: add vertical spacing (as if a paragraph break, but without starting a new paragraph)
Double Enter: really start a new paragraph (bigger spacing)
Important:
By default, Markdown considers a single line break as just a line break (not a paragraph break), and most themes won't add spacing there.
How to add spacing after single line breaks?
Unfortunately, Obsidian’s preview mode usually doesn't show single Enter line breaks as new lines unless you have Settings > Editor > Strict line breaks enabled (which makes a single Enter behave like a line break <br>).
If you want a visual gap after each single Enter (line break) in preview, here are options:
Option 1: Use "Strict line breaks" setting + CSS
Enable strict line breaks
Go to:
Settings > Editor > enable Strict line breaks
This makes a single Enter translate into <br> in preview instead of being ignored.
Add CSS to give vertical space after <br>
Add this CSS snippet to your vault (via snippets or theme CSS):
css
.markdown-preview-view br {
display: block;
margin-bottom: 0.8em; /* adjust spacing as you want */
}
This makes every single line break <br> behave like an empty block with vertical margin, creating visible vertical spacing between single-line-break lines.
Option 2: Use soft breaks + CSS (if you don’t want to enable strict line breaks)
But by default, without strict line breaks, single Enter inside paragraphs are ignored (but preserved in editor).
You cannot style these “soft breaks” in CSS because they don’t output any element.
Option 3: Use manual spacing (not recommended)
You could insert HTML <br> tags manually to force line breaks with CSS margin, e.g.:
markdown
Line 1.<br>
Line 2.
And style <br> as above.
Recap
To add space for single Enter line breaks in preview, enable Strict line breaks in Obsidian settings.
Then add CSS to style <br> elements with margin.
Double Enter will still create new paragraph with usual spacing.
If you want, I can provide the exact snippet for your Obsidian setup. Would you like that?
Got it! You want CSS that adds vertical spacing after single line breaks (i.e., <br>) both in Preview and in the Editing mode inside Obsidian.
Step 1: Enable Strict line breaks in Obsidian settings
This makes a single Enter insert a line break (<br>) in Preview view.
Step 2: CSS for Preview mode to add vertical spacing after <br>
Add this CSS snippet (via Appearance → CSS snippets):
css
.markdown-preview-view br {
display: block; /* makes br act like block-level element */
margin-bottom: 0.8em; /* vertical spacing after each <br> */
content: ""; /* just in case */
}
This adds space after each line break in the preview.
Step 3: CSS for Editor (Live Preview + Source Mode)
In the Obsidian editor, single line breaks (soft breaks) are usually rendered visually in Live Preview mode as a line break. But the actual representation is different, and <br> doesn’t literally exist in the editor DOM. Still, we can style the lines with a bit of trickery.
Use this CSS to add spacing after soft line breaks in the editor (work in both Live Preview and Source mode):
css
/* Live Preview mode */
.cm-s-obsidian.cm-line {
/* no changes here */
}
/* Add spacing after soft line breaks */
.cm-editor .cm-line > span:nth-child(n) {
/* no direct styling possible for soft breaks */
}
/* Instead, add spacing between wrapped lines */
.cm-editor .cm-line {
padding-bottom: 0.8em; /* add padding under each virtual line */
}
/* But this adds space after every line, so keep it if acceptable */
Note:
The CodeMirror editor (which Obsidian uses) does not provide a distinct HTML element for soft line breaks, so CSS targeting <br> is only for Preview mode.
If you want a visual gap between soft breaks inside editor:
The simplest way: add padding-bottom or margin-bottom to .cm-line (each editor line).
css
.cm-editor .cm-line {
padding-bottom: 0.8em;
}
Downside:
This adds space after every line, not just where you pressed Enter once, so it may feel like large gaps everywhere.
Putting it all together
css
/* PREVIEW: Add vertical spacing after single line breaks <br> */
.markdown-preview-view br {
display: block;
margin-bottom: 0.8em;
}
/* EDITOR: Add spacing after each line in editing mode */
.cm-editor .cm-line {
padding-bottom: 0.8em;
}
To install:
Save these styles in a .css file (e.g. line-break-spacing.css)
Put the file in your vault folder .obsidian/snippets/
Go to Obsidian Settings > Appearance > CSS snippets
Enable the snippet
Summary
In Preview, the <br> tag is styled to add space after a soft line break.
In Editor, each line has bottom padding to create visible spacing.
Let me know if you'd like this spacing only under specific circumstances or if you want a workaround that better preserves compact view in editor!