There are a few reasons why your logo and background might still be moving despite using position attributes of "fixed" and "relative" in CSS and HTML. Here are some possible solutions:
Check that you have specified the correct element for the position attribute. Make sure that you are targeting the element that you want to be fixed or relative, and that there are no conflicting CSS rules that are overriding your position attribute.
Make sure that your logo and background are contained within a parent element that has a fixed position. If your logo and background are contained within a relative or static position parent element, they will still move with the page.
Check that your logo and background are not being affected by other CSS rules. Sometimes, other rules such as float, clear, or margin can affect the position of elements on the page, even if you have specified a fixed or relative position attribute. Try removing other CSS rules temporarily to isolate the issue.
Try using a different position value, such as "absolute" or "sticky". Depending on the layout of your page, one of these values might work better for keeping your logo and background in place.
Consider using JavaScript to dynamically position your logo and background. Depending on the complexity of your layout, JavaScript might be the best option for achieving the desired effect.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-27 00:21:10 +0000
Seen: 8 times
Last updated: May 27 '23
Is it feasible to utilize a Toggle Button to switch among multiple classes exceeding 2?
What is the process for generating a dynamic subdomain/URL using vue.js?
How can I create a transition on click using CSS without the need for JavaScript?
How can the style of the loader be modified while the form submission is being processed?
I'm attempting to develop a Javascript-based comments section for my website.
What are some feasible methods to enable MIDI file playback on a web browser?