2017-01-05 3 views
2

私はcustom block in bookdownでリンクをスタイルしようとしています。カスタムブロックタイプは「rmdcomment」と呼ばれ、私はstyle.cssファイルに以下を追加しました:ブックダウンのカスタムブロックのスタイルリンク

.rmdcomment { 
    padding: 1em 1em 1em 4em; 
    margin-top: 30px; 
    margin-bottom: 30px; 
    background: #1f9ac9; 
    position:relative; 
    color: white; 
} 

.rmdcomment:before { 
    content: "\f075"; 
    font-family: FontAwesome; 
    left:10px; 
    position:absolute; 
    top:0px; 
    font-size: 45px; 
    color: white; 
} 

上記正しく表示されます。

私はまた、リンクスタイルにする(失敗した)の試みで、以下を追加しました:

.rmdcomment a:link {text-decoration: underline; font-weight:bold; color:white;} 
.rmdcomment a:visited {text-decoration: underline; font-weight:bold; color:white;} 
.rmdcomment a:hover {text-decoration: underline; font-weight:bold; color:white;} 
+0

私はあなたのHTML –

+0

てみ色で 'rmdcomment'クラスを見つけることができませんでした!:白; – Vcasso

+0

申し訳ありませんが、カスタムブロックの 'bookdown'パッケージの説明にリンクしています。あなたはここにそれを見ることができます:http://www.designsandmethods.com/ebook/research101.html#living-with-uncertainty –

答えて

3

私はこれがあなたが話しセクションであると考えています。

enter image description here

追加!重要なので、基本的に以前のスタイルを上書きします。使用

.rmdcomment a:link {text-decoration: underline !important; font-weight:bold !important; color:white !important;}

+0

ありがとう!それは知っている '重要な'です –

2

!重要なベストプラクティスではありません。あなたはいつでもあなたのCSSをより具体的にすることができます。このようにターゲット試してみてください、あなたは使用せずに同じ結果を得る必要があります。重要:

.book .book-body .page-wrapper .page-inner section.normal .rmdcomment a:hover { 
    text-decoration: underline; 
    font-weight: bold; 
    color: white; 
} 
関連する問題