The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Element style
Windsurfer
post Oct 14 2022, 11:12 AM
Post #1





Group: Members
Posts: 1
Joined: 14-October 22
Member No.: 28,587



I have a site and some pages have no values in the element.style but the other pages do.
What would be the reason for that ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 14 2022, 11:55 AM
Post #2


.
********

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



Impossible to say without seeing the pages in question, but generally speaking it could depend on how the style properties were set to begin with:

"The style property is not useful for completely learning about the styles applied on the element, since it represents only the CSS declarations set in the element's inline style attribute, not those that come from style rules elsewhere, such as style rules in the <head> section, or external style sheets. To get the values of all CSS properties for an element you should use Window.getComputedStyle() instead."
https://developer.mozilla.org/en-US/docs/We...MLElement/style



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: 28th March 2024 - 02:55 AM