Frage

Hi all I'm using Google Sites and I want to write a very simple CSS script in my page:

<style>p {background:#ccc;}</style>

However, Google removes all style tags. The solution they provide is to put our styles in an inline attribute as such:

<div style="...">

I've tried this but it doesn't work:

<div style="p {background:#ccc;}">

I was wondering how do we write a CSS "block-level-styles" within an inline style attribute tag?

War es hilfreich?

Lösung

You can't. Inline styles can only contain property-value declarations; they can't contain declaration blocks or selectors.

You would have to apply the background:#ccc inline style to all the p elements, unfortunately...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top