样式化动态内容

时间:2018-08-20 10:04:58

标签: php html css sql styling

我目前有一个简单的应用程序,该应用程序功能齐全,并使用php和sql查询数据。但是,由于属性似乎不适用,我正在努力对网站进行样式设置。我正在使用以下代码将我的搜索栏,下拉列表和提交按钮包装在一个类中,以使该类居中并在其周围放置边框。这是我在网页中使用的代码:

IF (!isset($_REQUEST['submit'])) {
    //drop down
    $sqlDrop = "SELECT DISTINCT ID as contID, Name as contName from w_Continent order by contName;";
    $stmtDrop = $db->query($sqlDrop);
//Start a form
    echo "<div class='searchWrap'>";
    echo "<form action='listCont.php' method='get'>\n";
//Start a select box
    echo "<select name='contID'>\n";
    echo "<option value=\"0\" disabled selected>Select Continent</option>";
//Loop through all continents
    while ($dropdownVar = $stmtDrop->fetchObject()) {
//Display each one as an option in the drop down
        echo "\t\t<option value='{$dropdownVar->contID}'> {$dropdownVar->contName} </option>\n";
    }//end loop
echo "</select>";
// Put filter textbox here
    echo "<input name='countFilter' type='text' placeholder='filter by country name'/>";
// display submit button
    echo "<input name ='submit' type='submit' value='Search' />\n";
    //end form
    echo "</form>";
    echo "</div>";

这是样式表中使用的代码:

.searchWrap {
    border-style: solid;
    text-align: center;
}

为大块代码表示歉意,只是我需要div包裹的所有内容来显示有关该问题的相关代码。任何帮助都会很棒。谢谢!

1 个答案:

答案 0 :(得分:2)

更改此

.searchWrap {
      border-style: solid; 
      text-align:center;
}

 .searchWrap {
      border:1px solid #ccc; 
      text-align:center;
}