The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Help Changing Multiple Font Colors
post Aug 31 2019, 03:40 AM
Post #1

Group: Members
Posts: 3
Joined: 31-August 19
Member No.: 26,977

So I have a somewhat simple problem I cant figure out.

I have a super simple web application that works.
I want to change it so that when a user enters a color like RED it outputs the word RED but in red text. Same goes with blue, green etc.

I understand that php doesn't do any formatting in regards to color, background fonts. etc. thats all with CSS/HTML.

Here is the output page

$your_name = $_POST['yourName'];
$your_color = $_POST['yourColor'];
$colors = [


<!DOCTYPE html>

    <link href="stylesheet2.css" rel="stylesheet" type="text/css" />


    <div id="content">
        <h1>This is the Second Page</h1>
        <p> Hello <?php echo $your_name; ?></p>
        <p> Your Favorite Color is <?php echo $your_color; ?>
        <p><a href="first.html"> Go Back</a></p>

Here is the CSS snippet for the form

#content {
    width: 450px;
    margin: 0 auto;
    padding: 0px 20px 20px;
    background: red;
    color: blue;
    border: 2px solid navy;


I have been wracking my brain on this problem for a better part of a week and Im certain it needs an inline style via
but cant figure out how to merge the two.

Thanks in advance
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 12th December 2019 - 06:32 PM