Thursday 2 April 2015

CSS attr, Angularjs, Tetrodotoxin

1. CSS attr

You can take the attributes values from the parent and display them using the pseudo elements ::before and ::after. See MDN's page on attr for further details.


<html>
  <head>
    <style>
      p::before {
        content: attr(data-foo) " small small " attr(data-bar) " ";
      }
    </style>
  </head>
  <body>
    <p data-foo="hello" data-bar="crazy">world</p>
  </body>
</html>

This displays "hello small small crazy world" in the page. I don't think this is going to be a good way to use it. Using the chrome extension chromeVox which simulates a screen reader, only the word "world" is read out. This is also the only word that can be copied from the visible text on the page. Looks like it could be useful for testing though.

2. Angularjs

This one is harder to pin down. I'm working my way through the angular.js developer documentation so I'm cementing my knowledge of angular and filling in various holes. I started with directives today and will finish off tomorrow.

3. Tetrodotoxin - the poison in puffer fish

Tetrodotoxin is found in various different species, mostly marine, but recently it has been found in a flatworm. Some use it for defence (the pufferfish has it in its skin), some for attack (the Bipalium flatworms has it mostly in its head)and some even to find mates! A few millilitres of this poison will kill a person within 20 minutes. This usually occurs by the paralysis of the diaphragm, thus causing respiratory failure.

No comments:

Post a Comment