Set space between divs

Float them both the same way and add the margin of 40px. If you have 2 elements floating opposite ways you will have much less control and the containing element will determine how far apart they are.

What does an asterisk (*) do in a CSS selector?

It is a wildcard, this means it will select all elements within that portion of the DOM. For example, if I want apply margin to every element on my entire page you can use: You can also use this within sub-selections, for example the following would add a margin to all elements within a paragraph … Read more

HTML/CSS float: left; is not working properly

First, it might be the issue that you are adding margin and paddings, which add size to the box even though the box has a width of 420px, you have to calculate margins and paddings to, or use * { box-sizing: border-box; }, which will calculate the width of that element as a sum of all … Read more

hide div tag on mobile view only?

You will need two things. The first is @media screen to activate the specific code at a certain screen size, used for responsive design. The second is the use of the visibility: hidden attribute. Once the browser/screen reaches 600pixels then #title_message will become hidden. EDIT: if you are using another CSS for mobile then just add the visibility: hidden; to #title_message. Hope this helps … Read more

How to center HTML5 Videos?

The center class must have a width in order to make auto margin work: Then I would apply the center class to the video itself, not a container: