[RESOLVED] My Code is Finally Complete!

The code that I wrote is supposed to be 270px wide and the fact that it works properly supports that.

I suggest that you increase the width of whatever box you are putting it into by 4px. That would be much easier than taking away 4px from the array of boxes.

is it easy to change 270 to 266?

How do you take px’s away from a box?

What did I just say?

How do you add px to a box width?

Aren’t all the boxes 50 x 50? With spacing in-between. width: 50px; height: 50px; That’s the size of the boxes.

This is your explanation.

I had wondered why yours was taller than the other one, but their both 266 in width.

Mine has 4 additional px of margin. That is why I mentioned the total width to you at the time the floats were introduced.

330 - 270 (the width of @ronpat’s code) = 50.

But you have a wrapper with a margin of 27px on either side, making a total of 54px. So that’s not all going to fit in the box. The easiest fix would be to change the 27px margins to 25px.

 .main-inner .section {
    margin: 0 27px;
    padding: 0;
}

both measure at 4px with in-between, what do you mean you added extra?

There is 2px margin on either side of each square. That means you have to remember to count 2px at each of the outer edges. That’s where the extra 4px comes from.

I thought you made them identical. Everything I have is 266 in width on the right side of my page.

No, they are not identical. The code is different.

The visible width is the same so they look identical, but mine does not spread out as the font size increases whereas the other does. Which do you prefer?

Yours, obviously. Cause it stays together without </br>tags

Try this file. Width is 266px. No top, bottom or side margins.

asasass-squares266.html (5.7 KB)

DO TEST thoroughly.

That’s using css though, if it fits, can I transfer it to the inline code? the margin specifications?

Code 1.) Mine was the one I made that was being held up by </br> tags.

Code 2.) You added float to it, so then that one became yours. Code 3.) And then the css one was yours entirely.

You weren’t clear about which one I preferred.

Also, the code you provided, Code 3) that can’t be put on a blogger blog, the one I made can.