Device Width Specific CSS Webpage Styling Primer Tutorial

v

Device Width Specific CSS Webpage Styling Primer Tutorial

Take a look at the CSS styling snippet below …


<style>

.glow {
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}

/* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */

@-webkit-keyframes glow {
from {
box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
}

to {
box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
}
}

@media only screen and (max-width: 768px) {
#widget2 {
-webkit-animation: glow 5s ease-in-out infinite alternate;
-moz-animation: glow 5s ease-in-out infinite alternate;
animation: glow 5s ease-in-out infinite alternate;
}
}

@media only screen and (max-width: 480px) {
#widget2 {
-webkit-animation: glow 4s ease-in-out infinite alternate;
-moz-animation: glow 4s ease-in-out infinite alternate;
animation: glow 4s ease-in-out infinite alternate;
}
}

@media only screen and (max-width: 320px) {
#widget2 {
-webkit-animation: glow 3s ease-in-out infinite alternate;
-moz-animation: glow 3s ease-in-out infinite alternate;
animation: glow 3s ease-in-out infinite alternate;
}
}
</style>

Apart from the “glow” ideas we last talked about with WordPress Blog TwentyTen Theme Glow Tutorial, that being the “what” of what we are doing, “where” are we applying it? Anyone, anyone? Yes, Casper Brindle, we’re differentiating “what” to do by device width.

And the “@” in CSS indicates a “rule”. So … yes, Casper Brindle? Indeed, they are called CSS @media Rules but no, Casper, it does not cover “Netflix After 10″ rules, OK?

And so, on our RJM Programming Landing Page set of HTML/Javascript/CSS “Software Need Not Be Hard” will glow for a lot of mobile users, and very few laptop users. As you can imagine, the use of such CSS can be invaluable.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>