bdg bdg - 7 months ago 23
PHP Question

styling a php form <input type="submit">

So I am trying to add some CSS styles to a php form I have the following CSS

#button {
font-size: 14;
border:none;
width:20ex;
height:10ex;
outline: none;
}


which I would like to add this to the form which is constructed within the p
php
element of the web page using the
id="button"
attribute.

From what I have read this should work.

$list = '';
while($row = $result->fetch_assoc()){
$title = $row['title'];
$id = $row['id'];
$summary = $row['summary'];
//I'm assuming you want each link to be different here...
$list.='<div class="Select_Course"><form name="courseselect" method="post" action="selectedcourse.php">
<input type="submit" name="subsearch" value="' .$title. '" id="button">
<input name="submitcourseselection" type="text" value="'.$title.'"hidden>
</form>
<p>' . $summary . '</p></div>';
}


However it does not apply the style
#button
from the CSS to this button.

How would i do this?

Thanks in advance.

Answer

You can change your css submit to this. Instead of using an id button

input[type=submit] {
    padding:5px 15px; 
    font-size: 14px;
    border:none;
    width:20ex;
    height:10ex;
    outline: none;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px; 
}