Help with css styling |
Help with css styling |
chrisj |
Jul 6 2021, 12:24 PM
Post
#1
|
Group: Members Posts: 9 Joined: 6-May 21 Member No.: 27,927 |
This javascsript code shows this:
CODE progressText = document.querySelector('#progress-bar .text'); I tried styling it with this, but no success: CODE #progress-bar .text { color: #800000; font: 20px arial; } CODE <span id="progress-bar .text"></span> what do I have wrong? |
Christian J |
Jul 6 2021, 02:07 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Interesting username.
CODE #progress-bar .text { color: #800000; font: 20px arial; } The CSS rule above applies to any HTML element with the CLASS "text" and which is a child of another element with the ID "progress-bar". QUOTE CODE <span id="progress-bar .text"></span> An ID attribute can only have one value. According to the stylesheet rule, the value "text" also needs to be in a CLASS attribute of a child element, and should not include the period sign. Something like this maybe: CODE <span id="progress-bar"> <span class="text">foo</span </span> |
Lo-Fi Version | Time is now: 19th April 2024 - 04:47 PM |