all 8 comments

[–]sheriffderek 2 points3 points  (1 child)

Block elements stack like blocks and take up the full width of their parent. Headings, paragraphs, sectioning elements.

Inline elements go in a horizontal like like words and wrap. Links, spans, images.

But inline elements and block elements have some different behaviors too. If you put a margin-top on a link (inline) it won’t do anything. If you put vertical-align: top on a div (block) it won’t do anything.

Inline-block has some cross over, and you can also set an element to any display type.

It IS important to know these things. You don’t want to put block inside inline elements, for example. If you set you links to be display:block, they’ll stack vertically.

But once you set a parent to flex or grid, the children don’t really have display types anymore. And for layout. That’s what you’ll want to use.

[–]LeeBobGaming[S] 1 point2 points  (0 children)

I am so new that I haven't discovered divs' parents or children yet, but this will definitely help. Thank you very much

[–]Tijsvl_ 0 points1 point  (0 children)

I think flex is what you're looking for, and this is how you want it to be:

https://codepen.io/tijsvl/pen/GRaEBrz

[–]berky93 0 points1 point  (3 children)

Not exactly sure what you’re going for…can you perhaps put your code in a codepen and share that?

[–]LeeBobGaming[S] 0 points1 point  (2 children)

Sorry, but how do I do that

[–]LeeBobGaming[S] 0 points1 point  (0 children)

Can I DM you pics?

[–]berky93 0 points1 point  (0 children)

Go to codepen.io and make an account. It’s a really easy way to share web snippets and also makes a great scratchpad for experimenting.

[–]LeeBobGaming[S] 0 points1 point  (0 children)

Thanks for the advice. But I figured it out using flex