ola

CSS pseudo-element Solar System

This is a remix of another author’s idea of using CSS to make a classic model of our solar system. Here, I’ve relied on CSS pseudo-elements and generated content to render scale models of the solar system from simple markup of the raw information.

There are three demos for this experiment, which is based on Alex Giron’s original Our Solar System in CSS3.

The basic demo uses only CSS and simple, semantic HTML to relatively faithfully reproduce Alex’s original result.

The advanced demo is a rough scale model of the Solar System. It uses the same HTML as the “basic demo” but makes extensive use of CSS pseudo-elements, generated content, and various bits of CSS3.

The advanced demo (keyboard support) is an attempt to provide keyboard support by introducing slight modifications to the HTML. I’ve commented out the animations in this version of the demo.

Why rework the original experiment?

I was curious to see if the same result could be achieved with simpler HTML, by relying on some newer CSS features.

I experimented a bit further with generated content, shadows, and the way the layout of the solar system is implemented. Doing this exposed me to some of the different ways modern browsers are implementing CSS3. I’ve described some of those differences and bugs below.

A scale model of the solar system

The main demo is a scale model of the solar system. It uses 3 different scales: one for the object diameters; one for the distance of the planets from the sun; and one for the orbital period of each planet.

Semantic HTML and Microdata

The HTML is a list where each list item contains a title and description. I’ve included some HTML Microdata to provide hooks for generated content.

<li id="earth" itemscope>
  <h2 itemprop="object">Earth
  <dl>
    <dt>Description</dt>
    <dd itemprop="description">Earth is an ocean planet. Our home world's abundance of water - and life - makes it unique in our solar system. Other planets, plus a few moons, have ice, atmospheres, seasons and even weather, but only on Earth does the whole complicated mix come together in a way that encourages life - and lots of it.</dd>
    <dt>Diameter</dt>
    <dd itemprop="diameter">12,755 <abbr title="kilometers">km</abbr></dd>
    <dt>Distance from sun</dt>
    <dd itemprop="distance">150×10<sup>6</sup> <abbr title="kilometers">km</abbr></dd>
    <dt>Orbital period</dt>
    <dd itemprop="orbit">365<abbr title="days">d</abbr></dd>
  </dl>
</li>

CSS pseudo-elements and generated content

Pseudo-elements are used to produce the planets, Saturn’s ring, the planet names, and to add the scale information.

Given that the scales only make sense when CSS is loaded it isn’t appropriate to have the scales described in the HTML. Both demos use the same HTML but only one of them is a rough scale model. Therefore, in the scale model demo I’ve used generated content to present the ratios and append extra information to the headings.

header h1:after {content:": A scale model";}
header h2:after {content:"Planet diameters 1px : 1,220 km / Distance from sun 1px : 7,125,000 km / Orbital period 1s : 4d";}

#earth dd[itemprop=diameter]:after {content:" (5px) / ";}
#earth dd[itemprop=distance]:after {content:" (22px) / ";}
#earth dd[itemprop=orbit]:after {content:" (91s)";}

Even more complex 3D presentations are likely to be possible using webkit-perspective and other 3D transforms.

Keyboard support

With a little modification it is possible to provide some form of keyboard support so that the additional information and highlighting can be viewed without using a mouse. Doing so requires adding block-level anchors (allowed in HTML5) and modifying some of the CSS selectors.

Modern browser CSS3 inconsistencies

This experiment only works adequately in modern browsers such as Safari 4+, Chrome 4+, Firefox 3.6+ and Opera 10.5+.

Even among the current crop of modern browsers, there are bugs and varying levels of support for different CSS properties and values. In particular, webkit’s box-shadow implementation has issues.

There are a few other unusual :hover bugs in Opera 10.5 (most obvious in the basic demo). It should also be noted that the :hover area remains square in all modern browsers even when you apply a border-radius to the element.

Border radius

There are also a few other peculiarities around percentage units for border radius. Of the modern browsers, a square object with a border-radius of 50% will only produce a circle in Safari 5, Chrome 5, and Firefox 3.6.

Safari 4 doesn’t appear to support percentage units for border radius at all (which is why the CSS in the demos explicitly sets a -webkit-border-radius value for each object). Safari 5 and Chrome 5 do support percentage units for this property. However, Chrome 5 has difficulty rendering a 1px wide border on a large circle. Most of the border simply isn’t rendered.

In Opera 10.5, if you set border-radius to 50% you don’t always get a circle, so I have had to redeclare the border-radius for each object in pixel units.

Opera 10.5’s incorrect rendering of border-radius:50%

It appears that this is one aspect of Opera’s non-prefixed border-radius implementation that is incorrect and in need of fixing.

Box shadow

Safari 4’s inferior box-shadow implementation means that inset shadows are not rendered on the planet bodies. In addition, the second box-shadow applied to Saturn (used to separate the planet from its ring) is completely missing in Safari 4 as it does not support a spread radius value.

Safari 5 and Chrome 5 are better but still problematic. The second box-shadow is not perfectly round as the box-shadow seems to use the pseudo-element’s computed border-radius. Furthermore, Chrome 5 on Windows does not properly support inset box-shadow meaning that the shadow ignores the border-radius declaration and appears as a protruding square.

Safari 5 and Chrome 5 make different mistakes in their rendering of this box-shadow

The use of box-shadow to separate Saturn from the ring isn’t strictly necessary. You can create the separated ring using a border but box-shadow cannot be applied in a way that casts it over a border. Another alternative would be to add a black border around the planet to give the illusion of space between itself and the ring, but all browsers display a few pixels of unwanted background colour all along the outer edge of the rounded border.

I wanted the ring to share the appearance of a shadow being cast on it. Opera 10.5 and Firefox 3.6 get it right. Both webkit browsers get it wrong.




ola

Tail risk hedging [electronic resource] : creating robust portfolios for volatile markets / Vineer Bhansali

Bhansali, Vineer




ola

Talent-Gespräche [electronic resource] : Worum es geht, weshalb sie wichtig sind, wie sie richtig geführt werden / Roland Smith und Michael Campbell

Smith, Roland, 1951- author




ola

Target opportunity selling [electronic resource] : top sales performers reveal what really works / Nicholas A.C. Read

Read, Nicholas A. C




ola

Wise money [electronic resource] : how the smart money invests using the endowment investment approach to minimize volatility and increase control / Daniel Wildermuth

Wildermuth, Daniel




ola

Working with IBM Records Manager [electronic resource] / Wei-Dong Zhu, Serena S. Chan, Gunther Flaig, Yi Wang, Keith Wheeler, R. Hogg, Yolanda Yates

Zhu, Wei-Dong, author




ola

JAMA Otolaryngology–Head & Neck Surgery : Effect of a Change in Papillary Thyroid Cancer Terminology on Anxiety Levels and Treatment Preferences

Interview with Brooke Nickel and Juan Brito, MD, MSc, authors of Effect of a Change in Papillary Thyroid Cancer Terminology on Anxiety Levels and Treatment Preferences: A Randomized Crossover Trial





















ola

JAMA Otolaryngology–Head & Neck Surgery : Safety Recommendations for Evaluation and Surgery of the Head and Neck During the COVID-19 Pandemic

Interview with Joshua K Tay, author of Surgical Considerations for Tracheostomy During the COVID-19 Pandemic: Lessons Learned From the Severe Acute Respiratory Syndrome Outbreak, and Babak Givi, MD, author of Safety Recommendations for Evaluation and Surgery of the Head and Neck During the COVID-19 Pandemic




ola

Indian scholar named Student of the Year at Birmingham varsity



  • DO NOT USE Indians Abroad
  • World

ola

Indian author sentenced for US campaign laws violation



  • DO NOT USE Indians Abroad
  • World

ola

Sikh group lauds USCIRF for recognising violation against them



  • DO NOT USE Indians Abroad
  • World

ola

Indian-origin researcher helps in Ebola vaccine trials



  • DO NOT USE Indians Abroad
  • World

ola

Goa cops book violators of lockdown

Taking cognisance of the photo published by TOI on Wednesday showing shacks operating at Ozran beach in North Goa in violation of lockdown norms, Goa police on Thursday booked the shack owner.




ola

Carbazole-based green and blue-BODIPY dyads and triads as donors for bulk heterojunction organic solar cells

Dalton Trans., 2020, 49,5606-5617
DOI: 10.1039/D0DT00637H, Paper
Jian Yang, Charles H. Devillers, Paul Fleurat-Lessard, Hao Jiang, Shifa Wang, Claude P. Gros, Gaurav Gupta, Ganesh D. Sharma, Haijun Xu
Two BODIPY derivatives with one (B2) and two (B3) carbazole moieties were synthesized and applied as electron-donor materials in organic photovoltaic cells (OPV), showing an overall PCE of 6.41% and 7.47%, respectively.
The content of this RSS Feed (c) The Royal Society of Chemistry




ola

Oxaliplatin and [Pt(R,R-DACH)(panobinostat-2H)] show nanomolar cytotoxicity towards diffuse intrinsic pontine glioma (DIPG)

Dalton Trans., 2020, 49,5703-5710
DOI: 10.1039/C9DT04862F, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Marie H. C. Boulet, Laura K. Marsh, Alison Howarth, Alice Woolman, Nicola J. Farrer
Oxaliplatin and the platinum(II) panobinostat complex (2) demonstrate nanomolar cytotoxicity towards diffuse intrinsic pontine glioma cells (DIPG); with 2 exhibiting improved solubility in comparison to panobinostat.
The content of this RSS Feed (c) The Royal Society of Chemistry




ola

Copolymerization of CHO/CO2 catalyzed by a series of aluminum amino-phenolate complexes and insights into structure–activity relationships

Dalton Trans., 2020, Advance Article
DOI: 10.1039/D0DT00726A, Paper
Hart Plommer, Laura Stein, Jennifer N. Murphy, Nduka Ikpo, Nelaine Mora-Diez, Francesca M. Kerton
Five aluminum catalysts demonstrated different selectivity and activity during reactions of carbon dioxide and epoxides.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




ola

Critical Perspectives on the Scholarship of Assessment and Learning in Law: Volume 1: England.

Online Resource




ola

The Anglo-American conception of the rule of law Nadia E. Nedzel, Nicholas Capaldi

Online Resource




ola

British justice, war crimes and human rights violations: the age of accountability / Susan L. Kemp

Online Resource




ola

The governance of solar geoengineering: managing climate change in the Anthropocene / Jesse L. Reynolds

Dewey Library - K3585.5.R495 2019




ola

Reclaiming indigenous governance: reflections and insights from Australia, Canada, New Zealand, and the United States / edited by William Nikolakis, Stephen Cornell, Harry W. Nelson ; foreword by Sophie Pierre

Dewey Library - K3247.R43 2019




ola

Director of the School: SISSA - Scuola Internazionale Superiore di Studi Avanzati

€Attractive: SISSA - Scuola Internazionale Superiore di Studi Avanzati
For more latest jobs and jobs in Italy visit brightrecruits.com






ola

Screening China's soft power / edited by Paola Voci and Luo Hui




ola

Polarizing Javanese society : Islamic, and other visions, c. 1830-1930 / M.C. Ricklefs

Ricklefs, M. C. (Merle Calvin), 1943-




ola

Report of the Parliamentary Delegation to the twenty-fifth Annual Meeting of the Asia Pacific Parliamentary Forum, Natadola, Fiji : Natadola, Fiji - 15-19 January 2017

Australia. Parliament. Delegation to the Annual Meeting of the Asia Pacific Parliamentary Forum (25th : 2017 : Natadola, Fiji)




ola

The Indonesian military response to reform in democratic transition : a comparative analysis of three civilian regimes, 1998-2004 / Poltak Partogi Nainggolan

Nainggolan, Poltak Partogi, 1963- author




ola

Revisiting India's partition : new essays on memory, culture, and politics / edited by Amritjit Singh, Nalini Iyer, Rahul K. Gairola




ola

[ASAP] Perspective on Cadmium and Lead in Cocoa and Chocolate

Journal of Agricultural and Food Chemistry
DOI: 10.1021/acs.jafc.9b08295




ola

[ASAP] Triterpene Glycosides Isolated from the Edible Sea Cucumber <italic toggle="yes">Bohadschia vitiensis</italic> and Their Antagonistic Activity against Transient Receptor Potential Ankyrin 1

Journal of Agricultural and Food Chemistry
DOI: 10.1021/acs.jafc.0c00847




ola

[ASAP] Eicosapentaenoic Acid-Enriched Phosphoethanolamine Plasmalogens Alleviated Atherosclerosis by Remodeling Gut Microbiota to Regulate Bile Acid Metabolism in LDLR<sup>–/–</sup> Mice

Journal of Agricultural and Food Chemistry
DOI: 10.1021/acs.jafc.9b08296




ola

[ASAP] Gel Properties of Soy Protein Isolate Modified by Lipoxygenase-Catalyzed Linoleic Acid Oxidation and Their Influence on Pepsin Diffusion and In Vitro Gastric Digestion

Journal of Agricultural and Food Chemistry
DOI: 10.1021/acs.jafc.0c00808