Template talk:Main Page Quote of the day

From Wikiquote
Latest comment: 11 years ago by Ningauble in topic Centering
Jump to navigation Jump to search

Centering[edit]

The code currently used here is no longer displaying the QOTD in properly centered fashion. I have noticed this for the last two days now, but an admin will need to make any necessary revisions. ~ Kalki·· 13:44, 19 September 2012 (UTC)Reply

Sample 1[edit]

Quote of the day
 
  Once the expenditure of effort exceeds the value of the political object, the object must be renounced and peace must follow.
We see then that if one side cannot completely disarm the other, the desire for peace on either side will rise and fall with the probability of further successes and the amount of effort these would require. … If the incentive grows on one side, it should diminish on the other. Peace will result so long as their sum total is sufficient — though the side that feels the lesser urge for peace will naturally get the better bargain.
~ Carl von Clausewitz ~
 
There is a page for each month where previous "Quotes of the Day" for each date are listed, and where registered users can make suggestions or rank suggestions for upcoming dates. The Quotes of the Year page and other archives contain more extensive listings of quotes that have already been used. See also the QOTD by month and email options.

I am not seeing the problem. Heading, quote, and author all appear centered as usual. Is there a specific code tweak that works better for you? ~ Ningauble (talk) 18:52, 19 September 2012 (UTC)Reply
I do see the problem when I look at the Main Page - although I have no idea how to fix it. :-) ~ UDScott (talk) 20:06, 19 September 2012 (UTC)Reply
I'm seeing the same problem; what are everyone's browsers? (Safari 6/Mac 10.8) I took a look at the code and couldn't immediately find where the problem was. Odd. EVula // talk // // 20:10, 19 September 2012 (UTC)Reply
I am using Firefox on a PC. ~ UDScott (talk) 20:12, 19 September 2012 (UTC)Reply
I have a theory about what is happening. The MediaWiki programmers have been experimenting with upgrading from HTML 4.01 to HTML 5. The Align and Valign attributes of the <td> element were supported but deprecated in HTML 4.01, and may not be supported any more. (I am using IE7 which tends to center table cell contents even without the attribute, by default – which has always been wrong.) Therefore, I tried moving the Center attribute from the <td> element to a <div>. Does the following "Sample 2" look any better in your browsers? ~ Ningauble (talk) 21:30, 19 September 2012 (UTC)Reply
I think you're on to something, as I just noticed that {{quotation limit}} was no longer centering (as the template's author, I know for a fact that I wouldn't have had it left-aligned). Sure enough, the centering code was for the table itself; deleting that didn't make a difference, and adding a bit of CSS to achieve the centering [if an element has a defined width, you can just set the left and right margins to auto] got it to work again. EVula // talk // // 22:59, 19 September 2012 (UTC)Reply
Independently of Ningauble's edits, I added a bit of code to {{Quote of the day}} to force the width; I noticed that long quotes worked just fine, but the shorter quotes didn't. That seems to have done the trick. (though I think Ningauble's would have as well) EVula // talk // // 22:50, 19 September 2012 (UTC)Reply
Works for me. ~ Ningauble (talk) 15:19, 20 September 2012 (UTC)Reply

Sample 2[edit]

Quote of the day
 
  Once the expenditure of effort exceeds the value of the political object, the object must be renounced and peace must follow.
We see then that if one side cannot completely disarm the other, the desire for peace on either side will rise and fall with the probability of further successes and the amount of effort these would require. … If the incentive grows on one side, it should diminish on the other. Peace will result so long as their sum total is sufficient — though the side that feels the lesser urge for peace will naturally get the better bargain.
~ Carl von Clausewitz ~
 
There is a page for each month where previous "Quotes of the Day" for each date are listed, and where registered users can make suggestions or rank suggestions for upcoming dates. The Quotes of the Year page and other archives contain more extensive listings of quotes that have already been used. See also the QOTD by month and email options.