View Full Version : Float div in bottom right of screen...
apriljoanne
05-06-2014, 07:52 AM
I want to create a contact div that is always on the bottom right of the screen and scrolls with the page. Can I do this in css? I am hesitant to use javascript because I have only been able to manage to get one script to work on my page at a time and don't want to break it. :)
I tried all sorts of positioning but haven't been able to figure it out. Any help is appreciated!
Beverleyh
05-06-2014, 10:02 AM
You sure can. Pop this into your markup and tweak away;
<div style="border:1px solid red; position:fixed; bottom:0; right:0; width:250px; height:150px;">FIXED CONTENT</div>
You can also separate the CSS and put it in your stylesheet;
HTML
<div class="fixed-box"></div>
CSS
.fixed-box {
border:1px solid red;
position:fixed;
bottom:0;
right:0;
width:250px;
height:150px;
}
apriljoanne
05-07-2014, 01:11 AM
Thank you! It worked! I had a similar code that half worked but couldn't figure out why it disappeared toward the footer of the page. I needed to add a z-index. I didn't think to add a border for testing- helped a ton in figuring it out :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.