Posted in css
3574
5:06 am, September 17, 2018
 

CSS Margin and Padding Framework Generator - How to use it

I used to just write this manually, but this generator is much easier than manually typing these margin and padding values.

So what this does is generate css for each step so if i do the default settings it will give you the main classes: where you replace the # with the step number. 

  • m# = margin #px
  • mt# = margin top #px
  • mb# = margin bottom #px
  • ml# = margin left #px
  • mr# = margin right #px
  • p# = padding #px
  • pt# = padding top #px
  • pb# = padding bottom #px
  • pl# = padding left #px
  • pr# = padding right #px

This tool generates the minified css for these values all the way up to 1000px if you really wanted that much css waste!

How do you use the classes?

Simply add an element like a div and add the class names, like this:

<div class='mb10 p20'>will give you a div with a margin on the bottom of 10px and padding 20 pixels</div>

Here is a generated working example

See the Pen Margin and Padding Framework tool testing by Luke (@vanderzone) on CodePen.

and here is a link to the tool:

CSS Margin and Padding Framework Generator

View Statistics
This Week
104
This Month
482
This Year
1068

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Articles
Search Articles by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
Nothing, to my way of thinking, is a better proof of a well ordered mind than a man's ability to stop just where he is and pass some time in his own company.
Seneca
Random CSS Property

@viewport

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
height (@viewport) css reference