Why isn't my margin-top working?
Hello everyone, I have tried a lot of things now, asked ChatGPT, told friends, rewrote everything myself and don't know what's wrong, can you help me?
Here's the problem: I'm writing HTML and CSS code and I don't understand why the last line
margin-top:200px; not working why is the span attribute still stuck so tightly at the top despite the margin 200
a has by default display: inline, whereby vertical margins have no effect. To set a margin, you must either use a
More information on MDN
ah ok thank you are the first to know(become the most helpful answer)just that wonders me because I think I’ve already set up at spans but maybe I’m mistaken also because margin left and right work why always lg
I just looked back. For inline elements, horizontal margin can be set, but no horizontal margin. I’ve edited the answer to correct it.
ah okay I thank you for everything you helped me very much :)lg
6 hours are not enough to go to any strange corner case of CSS. I have been using CSS regularly for about 7 years, and meanwhile I have quite a good intuition for it, but I would not say that I can understand and explain everything by now.
ok I thank you many times I see just a 6 hours html and css course only that he did not mention a single time anyways many thanks to you get the most helpful answer and many thanks again lg
A style block actually belongs to the
section. I don’t know if that’s the mistake. Browsers tend to forgive any misformatting.ok did it now, but still is not going
I think this needs a float or position attribute.
Thank you