position:fixed moving floated elements - html

I'm trying to create a fixed navigation bar with buttons(aligned left) and a title(aligned right). Before i fixed the position to the top of the page, it works as intended (other than not moving when scrolling, obviously). However, when i fix the position of the header, it moves my title over to the left with the buttons. How can I fix this? I've tried to make it into a div inside of the header tag and position:absolute the div; didn't work.
Here is what my page looks like

Related

css margin between Responsive Top Navigation and page content

I have a Responsive Top Navigation bar modeled from w3schools. Below that, I have various pages.
In the div, I have to specify a margin-top. The problem is when I resize the screen width, the menu goes to (2) lines. I can not figure out how to move the page content down to keep the same spacing between the menu and the page.
This might be happening because the top nav bar is positioned absolute. The absolute will make the top bar in a new layer. So the content is not moving down when top bar is in two lines. You can try removing the position absolute if the top bar has that style.

Moving Fixed/sticky Menu CSS

Looking to create a fixed menu that starts in middle of webpage, but when scrolling down fixes to the top of the page using CSS/HTML.
Is it possible to do this using a container? So the container with the menu starts below a top container and when the top container is scrolled off the page the menu is fixed to the top of that container and the top of the screen?
For example, how can I make it so that the image in the second container stays at the top of the screen when scrolling down the page, but make it stay in the second container:
https://codepen.io/Daggett/pen/mpBaab
position: sticky;
<!--doesn't stick!-->
Is there a way to do this only with CSS? I know it can be done with jQuery
Thanks!
position: sticky needs an explicit vertical position like top:0 to know where to stick to.

Make underlying sticky div clickable

On this page (Wordpress site), the pink element becomes sticky when it touches the menu. But this element is unclickable because of the logo on the left, which makes the menu wrapper higher, thus making the sticky element unclickable.
I can't use pointer-events:none on the menu div, because that makes the menu + logo unclickable.
Also, z-index is of no use as the sticky element is nested in the content wrapper. So if I'd make the z-index of the content higher than the menu, the content will scroll on top of the menu.
I should probably separate the sticky element from the content wrapper, but as I'm no expert with the Wordpress wireframes, I don't know how.
Or are there any other tricks I could try?
If you just set the class fusion-logo to position: absolute the logo container won't follow the normal flow of the element, so that fusion-header height will be the same of the navigation menu and the pink element will be right below to it, clickable

sticking div on the top on scroll with css only

I have a div in middle of my page.I want to fix it on the top when it reaches the top after scrolling down my page.I want to do this using css only without javascript.

Moving bootstrap div tag

I'm using bootstrap. I want a div element to move as I scroll the page downwards. How do I accomplish this please? For instance, I want the div element to follow me downwards as I scroll downwards and still maintain its position
This can accomplished with functionality jQuery plugin.
See more on the API call here
This jQuery plugin is used to fix elements on the page (top, bottom, anywhere); however, it still allows the element to continue to move left or right with the horizontal scroll.
Given an option marginTop, the element will stop moving vertically upward once the vertical scroll has reached the target position; but, the element will still move horizontally as the page is scrolled left or right. Once the page has been scrolled back down past the target position, the element will be restored to its original position on the page.
Using CSS, you can do it with the position attribute.
div{
position: fixed;
}