Forum:Templates help?

ShoutWiki — express yourself and be heard!
Jump to navigation Jump to search

Forums: Index Community help

So when I was creating templates for my wiki, I realized that some of the templates lacked 'borders':

s:w:en.alternatehistory:United States presidential election, 2008 (Hillary '08)

(compared to how it's supposed to look)

wikipedia:United States presidential election, 2004

Is there any solution to this? As far as I know, this happens to every other template/box on my wiki, such as on the front page:

s:w:en.alternatehistory:Main Page

--JoshuaTheRoman (talk) 02:41, 19 November 2016 (UTC)

Wikipedia sets borders using CSS. You don't set any with CSS or, specifically on the Main Page, you use style="... border:none ...". See developer.mozilla.org for details on the border property. --Saftzie (talk) 03:13, 19 November 2016 (UTC)
Could you mind elaborating on how to fix it? I'm not very experienced with CSS or HTML. --JoshuaTheRoman (talk) 03:25, 19 November 2016 (UTC)
ShoutWiki has a CSS help page, which kind of assumes you know what CSS is. Basically, site-wide CSS is set in MediaWiki:Common.css and various skin-specific messages, like MediaWiki:Vector.css for the Vector skin. Teaching you all about CSS would be beyond the scope of a forum post. There are tutorials at developer.mozilla.org and w3schools. The Mozilla one is better, but many beginners find the w3schools one friendlier, even though it can teach some bad practices. Mozilla and w3schools have HTML tutorials, as well. --Saftzie (talk) 03:53, 19 November 2016 (UTC)

I added the following to my infoboxes

  • border:1px solid #aaa;
  • width:300px;
  • float:right;
  • clear:right;
  • background:#f9f9f9;
  • margin:0 0 1em 1em;
{| class="infobox {{#if:{{{election_date|}}}|vevent|}}" style="{{#if:{{{map_image|}}}|{{#if:{{{map_size|}}}|{{#ifeq:{{Str rightc|{{{map_size}}}|2}}|px||width:{{Str number/trim|{{{map_size}}}}}{{Str rightc|{{{map_size}}}|2}};}}}}}} font-size: 88%; line-height: 1.5em; <!-- this added --> border:1px solid #aaa; width:300px; float:right; clear:right; background:#f9f9f9; margin:0 0 1em 1em;"
|+ class="summary" style="font-size: 125%; font-weight: bold" | {{{election_name|United States presidential election, 2000}}}
{{!}}-
{{!}} President-Elect
|}

Without

United States presidential election, 2000
President-Elect
With
United States presidential election, 2000
President-Elect


Percy (talk)

Thanks Percy, it works! http://en.alternatehistory.shoutwiki.com/wiki/United_States_presidential_election,_2008_(Hillary_%2708) --JoshuaTheRoman (talk) 15:29, 19 November 2016 (UTC) Also thanks to Saftzie, I understand what you mean now. http://en.alternatehistory.shoutwiki.com/wiki/MediaWiki:Common.css --JoshuaTheRoman (talk) 22:34, 19 November 2016 (UTC)