Removing Negative Margin



white-space: nowrap;

work with float:left?


If you use float correctly, you won't need the white-space: nowrap; rule.




Look at the code @PaulOB has already given you, using float. Do you see a white-space: nowrap; rule anywhere?


No I don't


How would I add it to this correctly then?


Add what?


float, you said it's wrong.


Where did I say that?




How come this says:


When it measures in at


I don't understand that.


That was a statement of fact, not a comment on your code.


This still wraps with float added.


You have 5 blocks 50px wide - 250px and each of those has a 4px margin on the right - 20px. Total, 270px.


How would I remove the margin off the last one?

How would I get the red to be 266px?

Meaning, only a margin between the middle 4, not the end blocks?

I assume, this would be possible to achieve.
It's just figuring it out.


You can use the nth-of-type selector to target every fifth link.

a:nth-of-type(5n+5) {margin-right: 0;}

That targets the fifth <a> element, and every fifth <a> thereafter.

You also need to set .links to 266px wide.


What happened?

Those 3 blocks are not supposed to be below.


I can't check just at the moment, but I think you need to put this line:

a:nth-of-type(5n+5) {margin-right: 0;}


the .links a rules in your CSS.


Using float:left; how is it achieved in this one without white-space:nowrap; being placed in the code??

no wrap being disabled?

How would I implement that with the playbutton code?



What has white-space: nowrap got to do with this? You only need it when you don’t want words or inline elements not to wrap.

I’m guessing you added it as a hack because your inline- block method was wrapping earlier than you wanted because you hadn’t taken care of the white space between and after inline and inline-block elements. Then you added another hack by adding an unneeded div to hold each 4 inline-block elements because they were not wrapping anymore

It’s just another example of why the method you chose was not the correct method in this case although you could beat it into submission.

I probably won’t be able to answer any more questions properly for a week or so as I am not at home and only have a mobile to type with.