legacy-knowledge-base
公開されました Jul. 2, 2025

LiferayのデフォルトCSSを個々のポートレットにオーバーライドする

written-by

Liferay Support

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

カスタム環境では、特定のポートレットにカスタムスタイルを適用する必要がある場合があります。 以下の例は、ポートレットを要件に合わせてカスタマイズするために、Liferay Theme CSSをオーバーライドする方法について説明します。

解像度

対象製品

Liferay Portal 6.0 EE SP2以上

入力テキストボックスの色とボタンのホバーカラーのCSS編集は、以下の例を参考にしてください。

1. ポートレットを追加した後、「Look and Feel > Advanced Styling」に移動します。
2. このポートレットだけのCSSルールを追加する」というリンクをクリックすると、以下のように作成されます:
#portlet_id {
}
3. フォーカス時のテキストフィールド入力について、Liferayはmain.cssで以下を使用しています。
input.focus,textarea.focus,.ie6 input.focus,.ie6 textarea.focus
4. ボタンホバー用
input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:focus, input[type="button"]:focus, input[type="reset"]:focus, button:hover, button:focus
#portlet_id 要素 { styles }のようにスコープを宣言したら、次にスタイル自体の宣言を始めることができます。
did-this-article-resolve-your-issue

legacy-knowledge-base