polaryeti Posted November 17, 2022 Share Posted November 17, 2022 https://codepen.io/pelko/pen/zYaEpqr I'm learning responsive design. (Make width <500px and see) I'm talking about this line: .dropdown, .subdropdown { position: static; width: 100vw; } https://imgur.com/a/US0klgu This is the behaviour I'm getting with and without position:static. But I fail to understand why? All information that I've about position:static is that it doesn't accept Top,Bottom,Left,Right values. Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/ Share on other sites More sharing options...
requinix Posted November 17, 2022 Share Posted November 17, 2022 This has nothing to do with static and everything to do with CSS rules. Just because you have media queries in one place does not mean that rules defined elsewhere without media queries are never applied. So: what other CSS do you have being applied to things like .dropdowns? Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602671 Share on other sites More sharing options...
polaryeti Posted November 17, 2022 Author Share Posted November 17, 2022 hmm. If you're interested in code, you can check the codepen.. Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602679 Share on other sites More sharing options...
Solution polaryeti Posted November 17, 2022 Author Solution Share Posted November 17, 2022 position:static places the document in default. the default is one at the top of other. this sounds reasonable to me. Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602680 Share on other sites More sharing options...
requinix Posted November 17, 2022 Share Posted November 17, 2022 5 hours ago, polaryeti said: hmm. If you're interested in code, you can check the codepen.. (psst I already know the answer) 5 hours ago, polaryeti said: position:static places the document in default. the default is one at the top of other. this sounds reasonable to me. Don't worry about what "static" means. That's not the issue here. Look at your CSS rules. If you provide that position:static then that takes effect. If you don't provide that position:static then what else will take effect? Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602684 Share on other sites More sharing options...
polaryeti Posted November 18, 2022 Author Share Posted November 18, 2022 position:absolute perhaps? Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602703 Share on other sites More sharing options...
polaryeti Posted November 18, 2022 Author Share Posted November 18, 2022 I'm not getting emails on this post, can you fix this issue? I've followed this topic. Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602704 Share on other sites More sharing options...
requinix Posted November 18, 2022 Share Posted November 18, 2022 37 minutes ago, polaryeti said: position:absolute perhaps? Correct. That is what's throwing off the layout. 37 minutes ago, polaryeti said: I'm not getting emails on this post, can you fix this issue? I've followed this topic. Check your notification settings - specifically, "Change how the notification is sent". Quote Link to comment https://forums.phpfreaks.com/topic/315546-cssnot-understanding-the-behaviour-of-positionstatic/#findComment-1602706 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.