The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help with css styling
chrisj
post 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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 6 2021, 02:07 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,649
Joined: 10-August 06
Member No.: 7



Interesting username. cool.gif

QUOTE(chrisj @ Jul 6 2021, 07:24 PM) *

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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 02:19 PM