Thread: margin: 0 auto;
View Single Post
Old 07-16-2010, 08:45 PM   #17
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Well, just changing it to inline didn't work, so here's the code that currently works. I'll play with it over the weekend and see if I can get it working with 'compliant' code.

Here's the CSS:
Code:
.centerblock {
	text-align: center;
	display: block;
	text-indent: 0em;
}
.verse {
	text-align: left;
	display: inline-block;
	text-indent: 0em;
	font-size: 0.85em;
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}
.vneg090 {
	margin-left: -0.90em;
}
.vnegxxx - etc for other indent amounts
And here's some text:
Code:
  <p class="paragraph-center">ANNIVERSARY ODE</p>
  <hr class="small" />

  <div class="centerblock">
    <p class="verse vneg320">Again we meet to celebrate<br />
    &nbsp;&nbsp;&nbsp;&nbsp;With badge and solemn rite,<br />
    Our fifty-second anniversary,<br />
    &nbsp;&nbsp;&nbsp;&nbsp;In Pickwick Hall, tonight.</p>
  </div>

  <div class="centerblock">
    <p class="verse vneg090">We all are here in perfect health,<br />
    &nbsp;&nbsp;&nbsp;&nbsp;None gone from our small band:<br />
    Again we see each well-known face,<br />
    &nbsp;&nbsp;&nbsp;&nbsp;And press each friendly hand.</p>
  </div>

  <div class="centerblock">
    <p class="verse vneg200">Our Pickwick, always at his post,<br />
    &nbsp;&nbsp;&nbsp;&nbsp;With reverence we greet,<br />
    As, spectacles on nose, he reads<br />
    &nbsp;&nbsp;&nbsp;&nbsp;Our well-filled weekly sheet.</p>
  </div>
And here's how it renders in ADE:



Those couple of verses don't appear perfectly centered, but notice I have 'vneg' on each of them because lower down there is an even wider verse. I use the widest verse as calibration (it would be 'vneg000') and everything else is negative-indented to align.

Also, before somebody says it, I know I could <span> and indent for the alternate lines rather than using repeated &nbsp; for spacing. Bad habit of mine...
EricDP is offline   Reply With Quote