Hello
I would like that the title of each article is placed in the centre and not at the left margin as it is the default. I presume I have to change the skin I use, but please could somebody give me a hint, where exactly?
thanks
Uwe Brauer
On 11/6/07, Uwe Brauer oub@mat.ucm.es wrote:
Hello
I would like that the title of each article is placed in the centre and not at the left margin as it is the default. I presume I have to change the skin I use, but please could somebody give me a hint, where exactly?
No need. You can style it using site CSS. Add to MediaWiki:Common.css:
.firstHeading { text-justify: center; }
or words to that effect.
"Andrew" == Andrew Garrett andrew@epstone.net writes:
No need. You can style it using site CSS. Add to MediaWiki:Common.css:
.firstHeading { text-justify: center; }
Thanks, I just realized that for a title which is centered is would be good to allow it to spread over more lines. Can that also be achieved in the same lines of code?
Uwe
On 11/6/07, Uwe Brauer oub@mat.ucm.es wrote:
Thanks, I just realized that for a title which is centered is would be good to allow it to spread over more lines. Can that also be achieved in the same lines of code?
You want to give it some width as well. In that case you need to change the method of centering, I suppose:
.firstHeading { margin-left: auto; margin-right: auto; width: 60%; }
You probably want to fiddle with the width until you like how it looks. Note that that might not work on some older browsers (I can't recall how well margin: auto centering is supported), and that due to improper line-height declarations, wrapped lines in headers don't look good in Monobook by default.
"Simetrical" == Simetrical Simetrical+wikilist@gmail.com writes:
You want to give it some width as well. In that case you need to change the method of centering, I suppose:
.firstHeading { margin-left: auto; margin-right: auto; width: 60%; }
You probably want to fiddle with the width until you like how it looks. Note that that might not work on some older browsers (I can't recall how well margin: auto centering is supported), and that due to improper line-height declarations, wrapped lines in headers don't look good in Monobook by default.
Thanks but it does not work for me on 1.9.3 using monobook. I did that changes in common.css.
"Andrew" == Andrew Garrett andrew@epstone.net writes:
No need. You can style it using site CSS. Add to MediaWiki:Common.css:
.firstHeading { text-justify: center; }
I checked with varios skins, it seems not to work :(
On 11/6/07, Uwe Brauer oub@mat.ucm.es wrote:
Hello
I would like that the title of each article is placed in the centre and not at the left margin as it is the default. I presume I have to change the skin I use, but please could somebody give me a hint, where exactly?
No need. You can style it using site CSS. Add to MediaWiki:Common.css:
.firstHeading { text-justify: center; }
or words to that effect.
text-align: center;
"Sneaks" == Sneaks 0vcqn5q02@sneakemail.com writes:
I would like that the title of each article is placed in the centre and not at the left margin as it is the default. I presume I have to change the skin I use, but please could somebody give me a hint, where exactly?
No need. You can style it using site CSS. Add to MediaWiki:Common.css:
.firstHeading { text-justify: center; }
or words to that effect.
text-align: center;
No seems not to work in MonoSkin, or any othr skin I tried.
Uwe Brauer wrote :
text-align: center;
No seems not to work in MonoSkin, or any othr skin I tried.
did you force-refresh your browser (ctrl+F5) ?
NB :
.firstHeading { text-align: center; }
works for me with 1.11
"Alexis" == Alexis Moinet alexis.moinet@fpms.ac.be writes:
Uwe Brauer wrote :
text-align: center;
No seems not to work in MonoSkin, or any othr skin I tried.
did you force-refresh your browser (ctrl+F5) ?
Yes, I even deleted the cache no effect
NB :
.firstHeading { text-align: center; }
I am on 1.9.3 and it does not, it is supposed to be skin independent, no? By the way I have the feeling the syntax is for the header, but I asked for the _title_ of the article.
Uwe
Uwe Brauer wrote :
I am on 1.9.3 and it does not, it is supposed to be skin independent, no? By the way I have the feeling the syntax is for the header, but I asked for the _title_ of the article.
Uwe
No the syntax is correct and is for the title of the article (which, in HTML, is inside a <h1> with class=firstHeading ), the one that is displayed on the article page, not for the header <title> (which is displayed at the top of your browser).
1.9.3 also work just fine for me.
You said you put the
.firstHeading { text-align: center; }
in common.css. Which common.css ? (I mean : is it the [[Mediawiki:Common.css]] page of your wiki ?)
Can you check in the HTML source code of one page of your wiki (firefox/IE : right-click on the page + "show source") that you do have something like this somewhere : <h1 class="firstHeading">Page title here</h1>
same thing for the file skins/monobook.php (assuming you're using monobook), can you check that there is <h1 class="firstHeading"> somewhere
Last thing, is there in your LocalSettings.php anything about CSS ? (e.g. : $wgUseSiteCss = false; which should be $wgUseSiteCss = true;)
"Alexis" == Alexis Moinet alexis.moinet@fpms.ac.be writes:
Uwe Brauer wrote :
I am on 1.9.3 and it does not, it is supposed to be skin independent, no? By the way I have the feeling the syntax is for the header, but I asked for the _title_ of the article.
Uwe
No the syntax is correct and is for the title of the article (which, in HTML, is inside a <h1> with class=firstHeading ), the one that is displayed on the article page, not for the header <title> (which is displayed at the top of your browser).
1.9.3 also work just fine for me.
You said you put the
.firstHeading { text-align: center; }
in common.css. Which common.css ? (I mean : is it the [[Mediawiki:Common.css]] page of your wiki ?)
I am not sure, it is the common.css of $Prefix/wiki/skins/common/common.css
Can you check in the HTML source code of one page of your wiki (firefox/IE : right-click on the page + "show source") that you do have something like this somewhere : <h1 class="firstHeading">Page title here</h1>
same thing for the file skins/monobook.php (assuming you're using monobook), can you check that there is <h1 class="firstHeading"> somewhere
Last thing, is there in your LocalSettings.php anything about CSS ? (e.g. : $wgUseSiteCss = false; which should be $wgUseSiteCss = true;)
Neither false nor true, should I add it anyhow? It has
$wgAllowUserCss = true;
"Alexis" == Alexis Moinet alexis.moinet@fpms.ac.be writes:
No the syntax is correct and is for the title of the article (which, in HTML, is inside a <h1> with class=firstHeading ), the one that is displayed on the article page, not for the header <title> (which is displayed at the top of your browser).
1.9.3 also work just fine for me.
You said you put the
.firstHeading { text-align: center; }
in common.css. Which common.css ? (I mean : is it the [[Mediawiki:Common.css]] page of your wiki ?)
Ok I put it in the wrong css file, now it works thanks.
Uwe
On 11/7/07, Uwe Brauer oub@mat.ucm.es wrote:
Yes, I even deleted the cache no effect
NB :
.firstHeading { text-align: center; }
I am on 1.9.3 and it does not, it is supposed to be skin independent, no?
Unfortunately not. Every such selector should be duplicated with .pagetitle, like this, if you want it to work on all skins:
.firstHeading, .pagetitle { ... }
For your purposes, I'm not sure why you'd want to make an aesthetic change like that to *all* skins. It seems unlikely that all would benefit from having their headings centered.
wikitech-l@lists.wikimedia.org