html - Vertical align top SELECT vs TEXTAREA -


i want know how these 2 elements vertically align. approach highlighted below doesn't work. see live demo here.

<?php $w.="<html><head><title>activity</title></head><body>\n"; $w.="<form action={$_server["php_self"]} method=post>\n"; $w.="<select name=listbox1 style=\"height:20px; width:100px\" vertical-align:top>\n"; $w.=" <option value=value1>option1</option>\n"; $w.=" <option value=value2>option2</option>\n"; $w.=" <option value=value3>option3</option>\n"; $w.="</select>\n"; $w.="<textarea name=value2 style=\"height:20px; width:200px\" vertical-align:top></textarea></br>\n"; $w.="</form></body></html>"; echo $w; ?> 

you missplaced closing quotes in styles both in select , in textarea:

 style=\"height:20px; width:100px\" vertical-align:top>  

to

style=\"height:20px; width:100px vertical-align:top\"> 

full script

<?php     $w.="<html><head><title>activity</title></head><body>\n";     $w.="<form action={$_server["php_self"]} method=post>\n";     $w.="<select name=listbox1 style=\"height:20px; width:100px; vertical-align:top\">\n"; //this line edited     $w.=" <option value=value1>option1</option>\n";     $w.=" <option value=value2>option2</option>\n";     $w.=" <option value=value3>option3</option>\n";     $w.="</select>\n";     $w.="<textarea name=value2 style=\"height:20px; width:200px vertical-align:top\"></textarea></br>\n"; //this line edited     $w.="</form></body></html>";     echo $w; ?> 

Comments