MasterACE14 Posted October 11, 2011 Share Posted October 11, 2011 I'm trying to center the 'feed_pagelinks' div at the bottom of the 'feed' div. I've got it at the bottom, but it's in the far left corner, I wish to center it and aren't having much luck. Any help is appreciated, thanks! div#feed { border: 2px solid #555; padding: 4px; margin-bottom: 20px; text-align: center; display: block; min-height: 100px; position: relative; } div#feed_pagelinks { margin: auto; margin-top: 15px; position:absolute; bottom: 0; margin-bottom: 5px; } <div id="feed"> {{update_feed}} {{feed}} <div id="feed_pagelinks">| {{page_links}} |</div> </div> Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 11, 2011 Share Posted October 11, 2011 try this. div#feed { border: 2px solid #555; padding: 4px; margin-bottom: 20px; text-align: center; display: block; min-height: 100px; position: relative; } div#feed_pagelinks { margin:0 auto; margin-top: 15px; position:absolute; bottom: 0; margin-bottom: 5px; } Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278048 Share on other sites More sharing options...
MasterACE14 Posted October 11, 2011 Author Share Posted October 11, 2011 no change :/ Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278049 Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 11, 2011 Share Posted October 11, 2011 use this instead. i changed the position from absolute to relative for div#feed_pagelinks <style> div#feed { border: 2px solid #555; padding: 4px; margin-bottom: 20px; text-align: center; display: block; min-height: 100px; position: relative; } div#feed_pagelinks { margin: auto; margin-top: 15px; position:relative; bottom: 0; margin-bottom: 5px; } Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278050 Share on other sites More sharing options...
MasterACE14 Posted October 11, 2011 Author Share Posted October 11, 2011 That has done the trick! Thank you kindly mate. Appreciated. Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278052 Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 11, 2011 Share Posted October 11, 2011 No Prob Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278053 Share on other sites More sharing options...
MasterACE14 Posted October 11, 2011 Author Share Posted October 11, 2011 ah still got one problem now, it's centered but it's not at the bottom of the div anymore. Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278055 Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 11, 2011 Share Posted October 11, 2011 if there is data in the feed, the feedlinks would be at the bottom. Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278067 Share on other sites More sharing options...
MasterACE14 Posted October 11, 2011 Author Share Posted October 11, 2011 ah you're right, I've missed the obvious. I've set the top margin for the feed_pagelinks to widen that gap. Looks great now, Thanks again! Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278080 Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 11, 2011 Share Posted October 11, 2011 haha. no prob goodluck Link to comment https://forums.phpfreaks.com/topic/248859-center-a-child-div-within-a-parent-div/#findComment-1278086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.