toplisek
08-05-2006, 09:00 AM
I have css for message and box has border. I would like that box will be automatic adjusted to text in message.
Current code is the following:
.message { width:38em;
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;
line-height: 16px; text-decoration: none;
background-color: #FFFFFF;border:1px solid #FF3300; padding:2px }
this is common problem with messages. e.g. validation reports error like
echo 'This <b>E-mail</b> is already in use. Please try another e-mail address.<br />';
and in another case message which is shoorter:
"The field <b>".$fieldname."</b> is empty.";
$fieldname variable is e.g. Password
So, message border width should be shorter if there is last (second) error.
Width should vary based on the amount of text in the element.
Do you have suggestion? Need help...:)
Current code is the following:
.message { width:38em;
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;
line-height: 16px; text-decoration: none;
background-color: #FFFFFF;border:1px solid #FF3300; padding:2px }
this is common problem with messages. e.g. validation reports error like
echo 'This <b>E-mail</b> is already in use. Please try another e-mail address.<br />';
and in another case message which is shoorter:
"The field <b>".$fieldname."</b> is empty.";
$fieldname variable is e.g. Password
So, message border width should be shorter if there is last (second) error.
Width should vary based on the amount of text in the element.
Do you have suggestion? Need help...:)