Part Three: Working with Spacing Elements

This is the LAST thing I do to a webpage layout. Mainly because it’s a waste of time doing it before all of your content has been placed. Spacing is a lot of work and you don’t want to have to do it twice… (If you can help it)

buying alprazolam in thailand In my first two blog posts, I talked about using the 3 sizing units => Percentage, EM, and Pixels. The first post covered creating your webpage’s layout containers and the second was working with text. Once these two things have been finalized and all of the content has been inserted, then it’s time to push everything away from the edges. Welcome to the conversation of working with block/inline elements and more specifically => margins, padding and borders => oh my!

buying alprazolam online

buy herbal xanax online One reason why these three properties are such a pill, is because of what the different browsers are doing with them behind your back ;~D. Sooooo the first thing to do, in the element spacing workflow, is to eliminate all browser styles (which are inherent in EVERY browser and even vary with browser versions). May I recommend starting with a CSS reset => the one that was recommended to me is CSS Tools: Reset CSS – by Eric A. and Kathryn S. Meyer This style sheet will ZERO out all the extra “help” the browsers and all their versions try to heap on your poor defenseless website. After you level the playing field, then you can add back the CSS needed to push your content away from the edges of your containers/DIVs without any interference!! To do that, let’s begin by talking about the Box Model. box_model

buy xanax craigslist

buy real alprazolam This identifies an element in HTML as having the ability to have borders, padding and margins. But when do we use them? Well, padding goes on the inside of the element/container/DIV, borders go on the edge and margins are applied to the outside. That, in my mind, makes it easy to decide. If you want to push content away from the edge you use padding, if you want to push the container you use margins and if neither are working that well…. I have cheated with borders ;~D Hey it happens… (on VERY rare occasions).

xanax order lorazepam

xanax american express padding-margin

That is the start of the spacing conversation, but where do we go from there? Translation => which measurement unit do we use to do this said spacing? That is the FUN part! (sarcasm implied) Let’s take the example of pushing text away from the inside of a simple header container. If you would like a 20 pixel buffer on the top and left edge only, that will take some thought. To make life easier (for me ;~D) => the layout we are making is inside a large container (1,000px wide) that is designed for a monitor 1,280px wide.


xanax uk buy

Since the content is inside the header we don’t need to factor in the 1,280px measurement. With the header taking up 100% the width of the big container, we will be calculating with 1,000px. (Remember you would have created the webpage mock up in pixels first – so you should know all the pixel dimensions) To calculate the percentage to push the left side over by 20 pixels => divide 20/1,000 for a percentage of 2%. Why percentage? It is because we are now thinking Responsively => RWD. With Response Web Design, we want the spacing to expand and contract with the containers on different mobile devices. You will want to calculate left and right spacing (padding) in percentages. That is not so with the height though. Because of responsive design => we CAN NOT assign a height*. If we do, we will break the layout when people change the device they use to view our page! Because of this I recommend using EM for the top and bottom spacing. (BTW => You could use EM for all spacing, but I think it is worth using percentages as much as possible… % is MORE responsive) You will remember that the default pixel size for fonts on a PC monitor (and many other devices for that matter) is 16px. Therefore 16px = 1EM. If I want a 20 pixel padding for the top I would divide 20 by 16, which equals 1.25em.

Your CSS3 would look like this:

header {
width: 100%;
padding-top: 1.25em;
padding-left: 2%;

*The reason why percentages do not work is because there isn’t a height assigned to be relative to.

xanax buy online That wouldn’t be so bad if I could stop on that note. However, what happens when you add padding, borders, and margins to containers? They get bigger! Remember you applied a width of 100% to the header (because you wanted it to span edge from to edge of the #container DIV). Well guess what? Right now – you have a header hanging over on the right side of your page by 2%. When you added padding on the left, the box model made the header larger. The fix? Subtract 2% from 100% and rewrite the width to be 98% for the header container.

alprazolam order Your CSS3 would look like this: header {
width: 98%;
padding-top: 1.25em;
padding-left: 2%;
} OUCH! Multiple that (pun intended) by all of the containers on your page and I am sure you are now in a little pain. Vell…. there is another way… you can apply padding to the content. If you apply the same percentage and EM to the h1 container, it will push the text over without changing the size of the header.
Your CSS3 would look like this: header {
width: 100%;

h1 {
padding-top: 1.25em;
padding-left: 2%; }

This can be built into the CSS for the p, h1,h2, etc… tags. Both work, but which will be most efficient? That will be determined by your layout. But I am telling you… do the spacing LAST!{{}} Happy Calculating!!

buy alprazolam europe No Comments Yet.{{}}

%d bloggers like this: