I am relatively new to CSS. I have run into a problem where I am trying to fix an element next to its parent element. I am able to do so with the following code:
Parent element:
#search_results{
position:relative;
}
Child element:
.total {
position: fixed;
top:10px;
width:250px;
left: 75%;
/*overflow: hidden;*/
margin-left: -125px;
}
This works fine until the browser window is resized. When that occurs, the fixed element overlaps its parent element. You can see my problem here: Twittiment
I am trying to fix the child element to the top of the page and the right-hand side of the parent element. Any ideas?
position: sticky
? – Jellifyposition: sticky
not supported by IE: caniuse.com/#feat=css-sticky – Lindie