css-position


Div position (margin:auto)


so I'm customizing my tumblr and my pagination is out of place. I put the pagination divs inside the content div so that it should vertically align on the bottom center of the page. but the pagination divs (the older and newer buttons) keep appearing on the bottom left corner instead of bottom center. i tried centering the pagination div with margin:auto and it seems to be stuck on the bottom left for some reason.
html:
<div id="content">
<div id="page">
<div class="pagination">
{block:NextPage} ←OLDER {/block:NextPage}</div>
<div class="pagination">
{block:PreviousPage} NEWER→ {/block:PreviousPage}</div>
</div>
css:
#content .pagination{margin:0 auto;
background-color:blue;
color:white;
border-radius:15px;
font-size:20px;
font-family:broadway;
}
#content .pagination a{margin:0 auto;
color:white;
opacity:.5;
}
#content .pagination a:hover {
color:white;
opacity:1.0;
filter:alpha(opacity=100);
}
#content #page .pagination {
display:inline-block;
}
You need to set
#page {
text-align: center;
}
If you are able to change the html markup, you could do your pagination like this:
<div class="pagination-wrapper">
<div class="pagination">
{block:NextPage} ←OLDER {/block:NextPage}
</div>
<div class="pagination">
{block:PreviousPage} NEWER→ {/block:PreviousPage}
</div>
</div>
and
.pagination-wrapper {
text-align: center;
}

Related Links

Relative positioning of custom controls with OpenLayers 3
How to set div height with relative position as child div with absolute position using css?
I'm trying to put a fixed divsion at the top of the page but when I scroll with FF, lines are lost
fixed position z-index not working
how to create adjustable gap between elements (div)
How to properly apply a css hack for IE11 transition misbehaviour
How do you make leaflet popup window full screen on small screens?
Fix a div to the bottom while scrolling with skrollr
Sticky Footer at bottom of PAGE, not just bottom of WINDOW
How to set div absolute position from the parent div
Polymer paper-fab with position:fixed behaves strangely when used with core-list that has a scrollTarget
What is the use of “static” positioning in CSS?
CSS: fixed position
Style sheet positioning won't keep everything in place
Div on top 100%
CSS float image align

Categories

HOME
beautifulsoup
localization
webdriver
gpu
3d
yahoo-finance
obfuscation
jsf-2.2
error-handling
parameters
bookmarks
barcode
qpython
google-schemas
fhir
appcelerator-studio
angular-dart
naivebayes
selenium-ide
frequency-distribution
3nf
atlassian-stash
asp.net-mvc-viewmodel
nodemcu
kendo-mobile
href
php-mysqlidb
zxing
draft-js-plugins
game-theory
itunes
surveymonkey
progress-bar
fractions
rpgle
event-flow
kudu
database-comparison
git-squash
android-sugarorm
lubridate
git-rewrite-history
flatmap
z-notation
google-data-api
numberpicker
mcustomscrollbar
ogc
resolution
vmware-fusion
escpos
movilizer
berkeley-db-je
dapper-simplecrud
linter
jquery-ui-draggable
dotnet-httpclient
twilio-click-to-call
manova
zenhub
payara-micro
pair-programming
static-cast
context-sensitive-grammar
boxing
colorbar
android-testing
flac
structuremap4
javafx-css
rmongo
mapxtreme
hadoop-2.7.2
burrows-wheeler-transform
model-associations
bizagi
cda
findfirst
state-restoration
java-money
binomial-theorem
rpart
ember-cli-rails
skspritenode
snoop
mraid
phpldapadmin
public-html
adehabitathr
iiop
trdion2011
reflector
grails-plugin-rabbitmq
ray
decoupling
koala
model-driven-development
css-reset
android-sdk-2.3
argouml
panda3d
patricia-trie
monotouch.dialog
zope.interface
paginator
subproject
predicatebuilder
cross-database
denied
http-daemon
cdonts
django-paypal
socketserver
binomial-heap
qtabbar
strtod
dsl-tools
escrow
sqlobject
leader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App