Destramic Posted December 18, 2014 Share Posted December 18, 2014 hey guys i have like 4 spans which show at the bottom right hand side of my page which are currently overlapping...i've tried to display as block but no success. any help would be greatful...thank you live demo: http://jsfiddle.net/sr5fta4m/ here is my code: .notification { padding: 15px; margin-bottom: 20px; border: 1px solid #eed3d7; border-radius: 4px; position: absolute; bottom: 0px; right: 21px; float: right; clear: right; diplay: block; } #alert-notification { color: white; background-color: #DA4453; } #success-notification { color: white; background-color: #37BC9B; } #information-notification { color: white; background-color: #4A89DC; } #error-notification { color: white; background-color: #DA4453; } <span class="notification" id="success-notification">Registration complete. Please check your mail.</span> <span class="notification" id="alert-notification">Account already activated.</span> <span class="notification" id="information-notification">Please check you email.</span> <span class="notification" id="error-notification">Wrong login detials.</span> Link to comment https://forums.phpfreaks.com/topic/293157-span-overlap/ Share on other sites More sharing options...
CroNiX Posted December 18, 2014 Share Posted December 18, 2014 Try putting the spans in a div container, and use the positioning on that container. I believe the problem is the absolute positioning of the spans. http://jsfiddle.net/sr5fta4m/4/ Link to comment https://forums.phpfreaks.com/topic/293157-span-overlap/#findComment-1500014 Share on other sites More sharing options...
BuildMyWeb Posted January 16, 2015 Share Posted January 16, 2015 youve positioned all four elements in the same place absolutely, relative to their container. .notification { ... position: absolute; bottom: 0px; right: 21px; ... } i could help you if you explained what it is youre trying to achieve. otherwise im only guessing. but you could try soemthing more like this: <style type='text/css'> #container { position: absolute; bottom: 0px; right: 21px; } .notification { padding: 15px; margin-bottom: 20px; border: 1px solid #eed3d7; border-radius: 4px; float: right; display: block; } #alert-notification { color: white; background-color: #DA4453; } #success-notification { color: white; background-color: #37BC9B; } #information-notification { color: white; background-color: #4A89DC; } #error-notification { color: white; background-color: #DA4453; } </style> <div id='container'> <span class="notification" id="success-notification">Registration complete. Please check your mail.</span> <span class="notification" id="alert-notification">Account already activated.</span> <span class="notification" id="information-notification">Please check you email.</span> <span class="notification" id="error-notification">Wrong login detials.</span> </div> Link to comment https://forums.phpfreaks.com/topic/293157-span-overlap/#findComment-1503106 Share on other sites More sharing options...
jeffreyappel Posted February 27, 2015 Share Posted February 27, 2015 Take a container div and put four div instead of four span into it and use floating . Link to comment https://forums.phpfreaks.com/topic/293157-span-overlap/#findComment-1506965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.