I realize this isn't specifically about PHP. However, it's regarding text on a .php page, displaying a couple pieces of data from php variables, so I'm hoping it's OK for the General Help format.
I have three lines of text that I want to use <H1> sizing on. Additionally, I want both the username and database name variables to display in green, while the remaining text will be displayed in black.
USERNAME
has successfully logged into the
DATABASE_NAME database
[/SIZE]
Unfortunately, by default, <H1> tags add a linefeed at the end of the element, so the desired three lines actually become six.
While searching the web I came across the "display:inline" CSS element. This removes the extra lines of white space, and it puts both the database name, and static text on one line, as I want. HOWEVER, when you use that style element, it ignores any text-align CSS that is also used within the element, so it's all shoved over to the left side.
[INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT]USERNAME
has successfully logged into the
DATABASE_NAME database
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT]
Is there a way of accomplishing what I want?
Current code using to format text:
<style type="text/css">
h1.green {color:green;
text-align:center;
font-style: italic;
display:inline;
}
h1.black {color:black;
text-align:center;
display:inline;
}
</style>
<table width="675">
<tr>
<td>
<h1 class="green"><?php print $_SESSION['username'] ?></h1>
</td>
</tr>
<tr>
<td>
<h1 class="black">has successfully logged into the</td>
</tr>
<tr>
<td>
<h1 class="green"><?PHP print $_SESSION['database_name'] ?></h1><h1 class="black"> database!!</h1>
</td>
</tr>
</table>