The CSSStyleDeclaration
interface represents an object that is a CSS declaration block, and exposes style information and various style-related methods and properties.
- Chrome Mozilla Internet Explorer
- Mozilla Internet Explorer 8 Free Download
- Mozilla Explorer Download
- Mozilla Keyword Explorer
- Mozilla Explorer
A CSSStyleDeclaration
object can be exposed using three different APIs:
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation. Portions of this content are ©1998–2021 by individual mozilla.org contributors. Content available under a Creative Commons license. Useful links: Aktier och aktiekurser online SweBiz links Find the best mortage rates - refinance your mortage News links Din guide till en bostad i Stockholm. Mozilla Manifesto. Learn about the values and principles that guide our mission. Mozilla Foundation. Meet the not-for-profit behind Firefox that stands for a better web. Join the fight for a healthy internet. Meet the team that’s building technology for a better internet.
- Via
ElementCSSInlineStyle.style
, which deals with the inline styles of a single element (e.g.,<div>
). - Via the
CSSStyleSheet
API. For example,document.styleSheets[0].cssRules[0].style
returns aCSSStyleDeclaration
object on the first CSS rule in the document's first stylesheet. - Via
Window.getComputedStyle()
, which exposes theCSSStyleDeclaration
object as a read-only interface.
Attributes
CSSStyleDeclaration.cssText
- Textual representation of the declaration block. Setting this attribute changes the style.
CSSStyleDeclaration.length
Read only- The number of properties. See the
item()
method below. CSSStyleDeclaration.parentRule
Read only- The containing
CSSRule
.
CSS Properties
CSSStyleDeclaration.cssFloat
- Special alias for the
float
CSS property. CSSStyleDeclaration
named properties- Dashed and camel-cased attributes for all supported CSS properties.
Methods
CSSStyleDeclaration.getPropertyPriority()
- Returns the optional priority, 'important'.
CSSStyleDeclaration.getPropertyValue()
- Returns the property value given a property name.
CSSStyleDeclaration.item()
- Returns a CSS property name by its index, or the empty string if the index is out-of-bounds.
- An alternative to accessing
nodeList[i]
(which instead returnsundefined
wheni
is out-of-bounds). This is mostly useful for non-JavaScript DOM implementations. CSSStyleDeclaration.removeProperty()
- Removes a property from the CSS declaration block.
CSSStyleDeclaration.setProperty()
- Modifies an existing CSS property or creates a new CSS property in the declaration block.
CSSStyleDeclaration.getPropertyCSSValue()
- Only supported via getComputedStyle in Firefox. Returns the property value as a
CSSPrimitiveValue
ornull
for shorthand properties.
Example
Specifications
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) The definition of 'CSSStyleDeclaration' in that specification. | Working Draft | Merged the DOM Level 2 StyleCSS2Properties interface into CSSStyleDeclaration . |
Document Object Model (DOM) Level 2 Style Specification The definition of 'CSSStyleDeclaration' in that specification. | Obsolete | Initial definition |
Browser compatibility
BCD tables only load in the browser
See also
World history is rife with epic power struggles, world-conquering tyrants, and heroic underdogs. The history of web browsers isn’t very different. University pioneers wrote simple software that sparked an information revolution, and battle for browser superiority and internet users.
Before Web Era
Chrome Mozilla Internet Explorer
In 1950, computers took up whole rooms and were dumber than today’s pocket calculators. But progress was swift, and by 1960 they were able to run complex programs. Governments and universities across the globe thought it would be great if the machines could talk, nurturing collaboration and scientific breakthroughs.
ARPANET was the first successful networking project and in 1969 the first message was sent from the computer science lab at University of California, Los Angeles (UCLA) to Stanford Research Institute (SRI), also in California.
That sparked a revolution in computer networking. New networks formed, connecting universities and research centers across the globe. But for the next 20 years, the internet wasn’t accessible to the public. It was restricted to university and government researchers, students, and private corporations. There were dozens of programs that could trade information over telephone lines, but none of them were easy to use. The real open internet, and the first web browser, wasn’t created until 1990.
Web Era
British computer scientist Tim Berners-Lee created the first web server and graphical web browser in 1990 while working at CERN, the European Organization for Nuclear Research, in Switzerland. He called his new window into the internet “WorldWideWeb.” It was an easy-to-use graphical interface created for the NeXT computer. For the first time, text documents were linked together over a public network—the web as we know it.
A year later, Berners-Lee asked CERN math student Nicola Pellow to write the Line Mode Browser, a program for basic computer terminals.
By 1993, the web exploded. Universities, governments, and private corporations all saw opportunity in the open internet. Everyone needed new computer programs to access it. That year, Mosaic was created at the National Center for Supercomputing Applications (NCSA) at the University of Illinois Urbana-Champaign by computer scientist Marc Andreessen. It was the very first popular web browser and the early ancestor of Mozilla Firefox.
NCSA Mosaic ran on Windows computers, was easy to use, and gave anyone with a PC access to early web pages, chat rooms, and image libraries. The next year (1994), Andreessen founded Netscape and released Netscape Navigator to the public. It was wildly successful, and the first browser for the people. It was also the first move in a new kind of war for internet users.
The Browser Wars
By 1995, Netscape Navigator wasn’t the only way to get online. Computer software giant Microsoft licensed the old Mosaic code and built its own window to the web, Internet Explorer. The release sparked a war. Netscape and Microsoft worked feverishly to make new versions of their programs, each attempting to outdo the other with faster, better products.
Netscape created and released JavaScript, which gave websites powerful computing capabilities they never had before. (They also made the infamous <blink> tag.) Microsoft countered with Cascading Style Sheets (CSS), which became the standard for web page design.
Things got a little out of hand in 1997 when Microsoft released Internet Explorer 4.0. The team built a giant letter “e” and snuck it on the lawn of Netscape headquarters. The Netscape team promptly knocked the giant “e” over and put their own Mozilla dinosaur mascot on top of it.
Then Microsoft began shipping Internet Explorer with their Windows operating system. Within 4 years, it had 75% of the market and by 1999 it had 99% of the market. The company faced antitrust litigation over the move, and Netscape decided to open source its codebase and created the not-for-profit Mozilla, which went on to create and release Firefox in 2002. Realizing that having a browser monopoly wasn’t in the best interests of users and the open web, Firefox was created to provide choice for web users. By 2010, Mozilla Firefox and others had reduced Internet Explorer’s market share to 50%.
Other competitors emerged during the late ‘90s and early 2000s, including Opera, Safari, and Google Chrome. Microsoft Edge replaced Internet Explorer with the release of Windows 10 in 2015.
Browsing the Web Today
Today there are just a handful of ways to access the internet. Firefox, Google Chrome, Microsoft Edge, Safari and Opera are the main competitors. Mobile devices have emerged during the past decade as the preferred way to access the internet. Today, most internet users only use mobile browsers and applications to get online. Mobile versions of the major browsers are available for iOS and Android devices. While these apps are very useful for specific purposes, they only provide limited access to the web.
Mozilla Internet Explorer 8 Free Download
In the future, the web will likely stray further from its hypertext roots to become a vast sea of interactive experiences. Virtual reality has been on the horizon for decades (at least since the release of Lawnmower Man in 1992 and the Nintendo Virtual Boy in 1995), but the web may finally bring it to the masses. Firefox now has support for WebVR and A-Frame, which let developers quickly and easily build virtual reality websites. Most modern mobile devices support WebVR, and can easily be used as headsets with simple cardboard cases. A 3D virtual reality web like the one imagined by science fiction author Neal Stephenson may be just around the corner. If that’s the case, the web browser itself may completely disappear and become a true window into another world.
Mozilla Explorer Download
Mozilla Keyword Explorer
Whatever the future of the web holds, Mozilla and Firefox will be there for users, ensuring that they have powerful tools to experience the web and all it has to offer. The web is for everyone, and everyone should have control of their online experience. That’s why we give Firefox tools to protect user privacy and we never sell user data to advertisers.