[英]Is it the proper way to mix CSS DIV with input form in PHP?
我的代碼顯示如下:
但是我不確定我是否正確實現了div和輸入形式的混合。
如果我以正確的方式執行此操作,您能否發表評論?
CSS:
.newstuff
{
width: 80%;
height: 100px;
}
.newstuff.left
{
float: left;
padding-left: 5px;
text-align: right;
width: 15%;
vertical-align: middle;
background: red;
}
.newstuff.center
{
float: left;
padding-left: 5px;
text-align: left;
width: 35%;
vertical-align: middle;
background: green;
}
.newstuff.right
{
float: left;
padding-left: 5px;
text-align: left;
width: 35%;
vertical-align: middle;
background: yellow;
}
.buttontest
{
float: left;
width: 35%;
}
PHP:
<?php
echo "<head>";
echo ' <link rel="stylesheet" href="test.css">';
echo "</head>";
echo '<body>';
echo '<div class="newstuff">';
echo ' <form action="'.htmlspecialchars($_SERVER["PHP_SELF"]).'" method="post" name="auth_form">';
echo '<div class="newstuff left">';
echo ' <input type="text" name="data1" placeholder="This is left">';
echo '</div>';
echo '<div class="newstuff center">';
echo '<textarea name="centertext" rows="5" cols="50" maxlength="255" placeholder="This is center"></textarea>';
echo '</div>';
echo '<div class="newstuff right">';
echo ' <input type="text" name="data3" placeholder="This is right">';
echo '</div>';
echo '</div>';
echo '<div class="buttontest">';
echo ' <input type="submit" name="test" value="Testing">';
echo " </form>";
echo '</div>';
echo "</body>";
?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.