Lesigner Girl
Minerva
Head of Runboard staff
Registered: 11-2005
Posts: 9597
Karma: 132 (+147/-15)
|
ReplyQuote
|
|
Control the size of signatures at your board
To stop huge signature images from messing up your layout or otherwise disrupting your discussions, you can limit the size of signatures with CSS.
Many browsers such as Mozilla's Firefox and Netscape's Navigator can check to see if an image is too big, then resize it with max-width and/or max-height if it doesn't meet your specifications.
Internet Explorer, on the other hand, doesn't understand max-width or max-height, so you have to control the normally-invisible box that surrounds the signature, adding a scrollbar to only the signature, or hiding the excess completely if you prefer.
To target the browsers that understand max-width and max-height so Internet Explorer will ignore it, we use html>body. To target Internet Explorer so the other browsers will ignore it, we use * html. With that explanation in mind, here is the code to put in your...
...CSS section:
To control both width and height:
html>body .ak_msg_post_signature_block img {
max-width: ???px;
max-height: ???px;
}
* html .ak_msg_post_signature_block {
width: ???px;
height: ???px;
overflow: auto;
padding-bottom: 20px;
}
Replace each occurrence of ??? with the sizes appropriate to your board and preference. Padding is added to the bottom of the signature in the IE-specific code, to keep the horizontal scrollbar from obscuring it.
To control width only:
html>body .ak_msg_post_signature_block img {
max-width: ???px;
}
* html .ak_msg_post_signature_block {
width: ???px;
overflow-x: auto;
padding-bottom: 20px;
}
Replace each occurrence of ??? with the sizes appropriate to your board and preference. Overflow is replaced with overflow-x, so only the horizontal scrollbar appears.
To hide the excess width and/or height in IE:
If you don't like the scrollbars and just want to hide any part of the signature that is too wide or tall, simply replace the overflow line with overflow: hidden; and leave the padding line out of your code completely.
If your members don't like part of their signature hidden this way, then they'll learn to use smaller signatures or deal with it being cropped. 
|
10/6/2006, 8:12 am
|
Link to this post
PM Lesigner Girl
Read Blog
|