Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.