Why do my components jump | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Why do my components jump

I had some html code with css. I closed it in the night looking a certain way, in the morning when i opened the code again the actual components had moved, for e.g. the border didnt encompass the contents anymore but had jumped up to close at the top of the page. You can see basic example here, the border instead of going around the text jumps up to the top and makes a very thin, short border, while still keeping the 70% width rule. Please help? https://code.sololearn.com/WM9WVLii5755/?ref=app You can see the whole problem here: https://code.sololearn.com/WJoRS4ZC92uR/#html Click run and you'll see the border goes to the top instead of around the content. It was around and then suddenly jumped. Thanks!

22nd Apr 2020, 7:16 PM
Devora Jones
Devora Jones - avatar
9 ответов
+ 1
Ok finally I found the problem , float is causing the problem ,either clear each of them or just add display:grid or display:flex in body , now i don't know how it all works ,since i am new to css but flex and grid are used nowdays because of the problems that arises from float as I have been reading !!
22nd Apr 2020, 10:25 PM
Abhay
Abhay - avatar
0
I didn't really understood the problem from the code you provided , everything looks correct in it if I am not wrong!
22nd Apr 2020, 8:05 PM
Abhay
Abhay - avatar
0
Exactly, I didnt change the code overnight, it just jumped I really dont understand why. This happened also in the middle of working with other components like social media button floats which were in the right place and suddenly jumped. I tried looking for answers on the web but could not find, what could cause this?
22nd Apr 2020, 8:17 PM
Devora Jones
Devora Jones - avatar
0
Can't help without looking into code myself ,or atleast a part of the code that you think is causing the problem , because I really Don't understand what you mean by jumping of the elements Or maybe wait for someone else to help!
22nd Apr 2020, 8:24 PM
Abhay
Abhay - avatar
0
Idk what to tell you, I copied what code I had. I dont understand it either!
22nd Apr 2020, 8:25 PM
Devora Jones
Devora Jones - avatar
0
What did you meant by border instead of going around text jumps up to the top and makes a very think short border ,while still keeping 70% width rule, isn't that how it should be according to the style you have provided it ?
22nd Apr 2020, 8:34 PM
Abhay
Abhay - avatar
0
The text and link content should be inside of it, not under it. Basically the height of the border becomes approx 3px.. What I wanted was a border for the whole page, whatever the content in it. Like in the page https://brooklynanimalaction.org/
22nd Apr 2020, 8:37 PM
Devora Jones
Devora Jones - avatar
0
You can see the whole problem here: https://code.sololearn.com/WJoRS4ZC92uR/#html Click run and you'll see the border goes to the top instead of around the content. It was around and then suddenly jumped. Thanks!
22nd Apr 2020, 8:46 PM
Devora Jones
Devora Jones - avatar
0
Thanks ill definitely erase the floats. It was helping me arrange the contents and the border was all fine at first, so it was comfortable. Thanks you If you're new to css how do you know so much? :)
22nd Apr 2020, 10:55 PM
Devora Jones
Devora Jones - avatar