Help for positioning in css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Help for positioning in css

Greetings🌸 I actually need help I had made this code long time ago and now my friend showed me this And the ring of the Saturn were not at the exact place were it should be Suggest me What PROPERTY and VALUE should be placed to get the exact results in every screens https://sololearn.com/compiler-playground/WfnGNHJ18Mte/?ref=app https://www.sololearn.com/post/1756920/?ref=app

17th Mar 2024, 8:58 AM
Kim 반테
Kim 반테 - avatar
17 Answers
+ 1
Kim 반테 I cleaned up the code a bit. I tried to use more consistent units and removed duplicates. I also added the missing pop animation keyframes. Try to view it in a browser to see if it breaks apart. https://sololearn.com/compiler-playground/WMaZH8VZsz66/?ref=app
18th Mar 2024, 3:52 AM
Bob_Li
Bob_Li - avatar
+ 6
।।।।।।। Can you please go through it And tell me the exact positioning?
17th Mar 2024, 1:06 PM
Kim 반테
Kim 반테 - avatar
+ 6
Bob_Li I'm not taking about container and mountain of this code If you have seen my other codes In that code i am facing the same problem
17th Mar 2024, 3:04 PM
Kim 반테
Kim 반테 - avatar
+ 5
Tibor Santa Thanks for this I'll look after this But i am certainly facing this problem in my most of my codes
17th Mar 2024, 9:09 AM
Kim 반테
Kim 반테 - avatar
+ 5
Bob_Li Yaah I'll set the positioning here in this code But the real thing I'm facing this problem in most of my codes Somewhere in container, orbits , mountains etc etc
17th Mar 2024, 1:37 PM
Kim 반테
Kim 반테 - avatar
+ 5
Bob_Li so I need specific property to get ride of this problem
17th Mar 2024, 1:38 PM
Kim 반테
Kim 반테 - avatar
+ 5
.saturn { position:absolute; top:50px; margin:0; padding:0; width:5.5em; height:5.5em; border-radius:100%; background: linear-gradient(to bottom right, #ffd857, #d64fff, #8059ff, #54ffff); box-shadow:0 0 15px #d64fff, 0 0 9px #009dff; border:1px solid purple; animation: spin 6s infinite linear; } .container{ width: 170px; height: 170px; position: fixed; margin:0; padding:0; } .ring{ background:transparent; position:absolute; top:calc(200px / 2 - 5.5em - 16px * 2 - 2px + 170px / 3); left:calc(200px / 2 - 5.5em - 16px * 2 - 2px); height:calc(5.5em * 2); width:calc(5.5em * 2); border-radius:50%; border:16px solid #d64fff; border-bottom:5px solid transparent; transform:rotateX(100deg); border-right-color:#8c2eff; border-left-color:#009dff; margin:0; padding:0; } .wrapper { width: 200px; height: 200px; display: block; top:196px; position:relative; margin:0; padding:0; } 👇
17th Mar 2024, 2:43 PM
Solo
Solo - avatar
+ 5
Solo Hola well thanks for that But I want some SPECIFIC PROPERTY to set my all code so that whenever it is seen from other devices like tab laptop etc in all screen it should appear the same
17th Mar 2024, 3:06 PM
Kim 반테
Kim 반테 - avatar
+ 4
.ring{ ... top: ??? px; ... } Try changing this until it looks ok to you. :) I don't know about EXACT value, I am not familiar with interstellar geography :)
17th Mar 2024, 9:02 AM
Tibor Santa
Tibor Santa - avatar
+ 4
maybe .ring{ ... top:230px; ... }
17th Mar 2024, 1:17 PM
Bob_Li
Bob_Li - avatar
+ 4
Bob_Li right though at 205 px it's even better
17th Mar 2024, 1:19 PM
Manuphile
Manuphile - avatar
+ 3
https://css-tricks.com maybe they might ve covered regarding it in some blogs
17th Mar 2024, 10:38 AM
Manuphile
Manuphile - avatar
+ 3
।।।।।।। it will put the front of the ring at rhe center, but the back feels too high at 205px. Remember the view is slightly from above, that's why we see an ellipse instead of a line. Centering the major axis of the ellipse feels like a better choice.
17th Mar 2024, 1:24 PM
Bob_Li
Bob_Li - avatar
+ 3
Kim 반테 your container does not contain anything at all. also, what mountains...? I'm not sure I understand. perhaps if you nest everything inside a container div, it will be easier to move and resize the entire collection of divs as a group.
17th Mar 2024, 1:57 PM
Bob_Li
Bob_Li - avatar
+ 3
👆 I haven't done this for a long time, but if my memory serves me correctly, then the dimensions are determined like this. Now, wherever you move the Saturn wrapper, everything will remain in its place. It is also necessary to pay attention to what to measure, px is stable, em adapts to the screen size...😎
17th Mar 2024, 2:52 PM
Solo
Solo - avatar
+ 2
Kim 반테 really sorry but I can't atleast today 🤭😅
17th Mar 2024, 1:08 PM
Manuphile
Manuphile - avatar