Reputation:
I'll include a basic example code; im trying to understand how to add css editing to a php file - within the file. Currently when the webpage opens from the server the editing is not applying.
lets say I want the variable myBirthday in the following code to increase in size and change colour to red, how do i fix this code?
<head>
<title>
countdown
</title>
<style type=”text/css”>
#myBirthday
{
font-size: 100;
color: #FF0000;
}
</style>
</head>
<body>
<h1>
My birthday.
</h1>
<?php
$myBirthday = "10th October 1997";
echo "Tell you a secret, my birthday is " . $myBirthday . <br> "Today is " .date('d-m-y') . ". <br>";
?>
</body>
Upvotes: 1
Views: 31
Reputation: 1447
I enclosed the myBirthday
variable within a span
which I gave the ID myBrirthday
in order to style it with the CSS code you provided
<body>
<h1>
My birthday.
</h1>
<?php
$myBirthday = "10th October 1997";
echo "Tell you a secret, my birthday is <span id=\"myBirthday\">" . $myBirthday ."</span> <br> Today is " .date('d-m-y') . ". <br>";
?>
</body>
Also note that double quotes must be escaped when inside the "echo" statement.
Upvotes: 1