Jump to content

Specify width of input box in php


jkkenzie

Recommended Posts

I would to specify the size(leght or width) of the input box with the code below:

 

echo "<select name='country'>";
while($nt=mysql_fetch_array($result2)){
echo "<option value='$nt[country]'";
if($nt[country] == "KENYA") { echo " selected"; }
echo ">$nt[country]</option>";
}
echo "</select>";

 

Thanks in advance

 

Joe

Link to comment
https://forums.phpfreaks.com/topic/104851-specify-width-of-input-box-in-php/
Share on other sites

Do it with CSS =)

 

Google "Style select box with CSS" and you will find some great articles.  Select boxes are one of the more tricky elements to style correctly, but width is really easy.

 

.selectbox{
width:100px;
}

 

Then apply class='selectbox'

 

Hope that helps!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.