Forum:Need some help with templates

Hey,


 * I'm working on Reptipedia, and I could use some help making the templates stable.


 * First off is the Stub template. It looks nice at first, but I'm having trouble keeping it consistent when put to practice. For example, if I put it on a stub article, under certain circumstances the box will change shape or move out of the text area, or the image will move. The box also tends to mess up when it's near another template, like an infobox. I need the image to stay right where it is, and the box to stay centered and not interfere with anything. If anyone could help me with this, that'll be great. --Thesaurus Rex 04:13, July 25, 2011 (UTC)


 * You could add  on the bottom of the template code to ensure the template won't align with other objects if you place the template on top of the page. — Sovq 05:23, July 25, 2011 (UTC)
 * Okay. How do I implement that in now? Thesaurus Rex 05:02, July 26, 2011 (UTC)


 * Add that to the bottom of your template.--
 * Cool, it worked! Now how exactly do I make the image stop moving around? Here's the American Alligator page for reference. Thesaurus Rex 08:10, July 26, 2011 (UTC)


 * I cleaned the template code up a bit - hope that's no problem? Now it shouldn't re-align the image. Also, you don't need to add a number of new lines before the template - you can place it just under the article text and it should display as intended (I hope). — Sovq 09:15, July 26, 2011 (UTC)
 * Awesome, thanks. I'm not too good at this CSS stuff, lol. If there's one more thing, and that might be it, but is there a way to put a border around the images? Thanks. Thesaurus Rex 12:31, July 26, 2011 (UTC)
 * You need to add  around the image, and change   to the color you want.
 * Sure, just replace |Geckostub.png
 * with:


 * style="width:50px; border:1px solid #667755;"|Geckostub.png
 * Be sure to have the image size and the width parameters the same or else the border may include a bit more than just the image.
 * But then again, you are going to replace that image, aren't you? Template-info.svg looks better for it.
 * It's a matter of taste but I've always seen the stub notice (and others) being put on the top of the page, I don't know if you just put it at the end and didn't care.
 * 13:36, July 26, 2011 (UTC)
 * Okay then, thank you. A new problem arose here...I'm trying to make this here missing license template, but the box around the image is too tall. Can this be fixed with some sort of padding parameter or what? Thesaurus Rex 13:13, July 28, 2011 (UTC)


 * If you mean making it less wide, remove the width: 120px from that box. - Tjcool007 (Talk) 14:28, July 28, 2011 (UTC)
 * No, I mean making it less tall. It is too large in terms of height. The image itself is not that tall. Thesaurus Rex 14:51, July 28, 2011 (UTC)
 * In that case you'll need to add a div, which takes over the style of the td: change this:

...
 * To:

 ...
 * And adjust height of the div if needed. - Tjcool007 (Talk) 15:00, July 28, 2011 (UTC)
 * Uhm...where exactly is the td at? Also I tried that, and it messed up. I changed this:

|style="background:#ccff99; border:1px solid #667755;"|

to this:

<div style="background:#ccff99; border:1px solid #667755;"|

That just pushed the picture out of the box and just messed it up...Gosh, I'm retarded. --Thesaurus Rex 15:59, July 28, 2011 (UTC)