Layout-Problem mit sticky Kapitelüberschrift
bearbeitet von
@@Linuchs
> ~~~html
> <style>
> h2:target + div, h2:target + div + p, h2:target + p {
> margin-top: 4em;
> }
> </style>
> ~~~
Wenn du HTML in einen Codeblock schreibst (hier ein `style`-Element), dann musst du auch HTML als Sprache angeben, nicht CSS. Oder die `<style>`{:.language-html}-Tags weglassen, dann isses CSS. Ich hab das mal gefixt.
Das Wiederholen von `h2:target`{:.language-css} kann (sollte) man vermeiden:
```css
h2:target {
+ div, + div + p, + p {
margin-top: 4em;
}
}
```
🖖 Live long and prosper
{:@en}
--
*“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”*{:@en}
— Bruce Springsteen, Manchester 2025-05-14
Layout-Problem mit sticky Kapitelüberschrift
bearbeitet von
@@Linuchs
> ~~~html
> <style>
> h2:target + div, h2:target + div + p, h2:target + p {
> margin-top: 4em;
> }
> </style>
> ~~~
Wenn du HTML in einen Codeblock schreibst (hier ein `style`-Element), dann musst du auch HTML als Sprache angeben, nicht CSS. Oder die `<style>`-Tags weglassen, dann isses CSS. Ich hab das mal gefixt.
Das Wiederholen von `h2:target` kann (sollte) man vermeiden:
```css
h2:target {
+ div, + div + p, + p {
margin-top: 4em;
}
}
```
🖖 Live long and prosper
{:@en}
--
*“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”*{:@en}
— Bruce Springsteen, Manchester 2025-05-14