Skip to content

Instantly share code, notes, and snippets.

@anovsiradj
Last active Aug 19, 2018
Embed
What would you like to do?
Blogger/Blogspot dynamic CSS classes
<!-- https://ne-a-r.blogspot.com/ -->
<!-- padding/margin kelipatan 2 dan 5 (0 sampai 100)-->
<style>
<b:loop index='i' values='0 to 100' var='n'>
<b:if cond='data:n%5 == 0 OR data:n%2 == 0'>
.pd-<data:n/>{padding:<data:n/>px !important;}
.pd-t-<data:n/>{padding-top:<data:n/>px !important;}
.pd-b-<data:n/> {padding-bottom:<data:n/>px !important;}
.pd-l-<data:n/>{padding-left:<data:n/>px !important;}
.pd-r-<data:n/>{padding-right:<data:n/>px !important;}
.mg-<data:n/>{margin:<data:n/>px !important;}
.mg-t-<data:n/>{margin-top:<data:n/>px !important;}
.mg-b-<data:n/> {margin-bottom:<data:n/>px !important;}
.mg-l-<data:n/>{margin-left:<data:n/>px !important;}
.mg-r-<data:n/>{margin-right:<data:n/>px !important;}
</b:if>
</b:loop>
</style>
<!-- width/height kelipatan 5 (1% sampai 100%) -->
<style>
<b:loop index='i' values='1 to 100' var='n'>
<b:if cond='data:n%5 == 0'>
.w-<data:n/>p {width:<data:n/>%;}.h-<data:n/>p {height:<data:n/>%;}
</b:if>
</b:loop>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment