0

I would like to know how to position string of php origin using css, I made a login form after logging in the users are directed to a dashboard where I would like to view their username in a particular location,

this is my code:

CSS

// font to decorate the username string
@font-face {
    font-family: 'chunkfiveroman';
    src: url('chunkroman/chunkfive-webfont.eot');
    src: url('chunkroman/chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
         url('chunkroman/chunkfive-webfont.woff') format('woff'),
         url('chunkroman/chunkfive-webfont.ttf') format('truetype'),
         url('chunkroman/chunkfive-webfont.svg#chunkfiveroman') format('svg');
    font-weight: normal;
    font-style: normal;

}

#postioner
{
position:absolute;
left:100px;
top:100px;
}

PHP

<?php

session_start();
$_SESSION['var'] = $username;
?>

also I would like to know how to stlye the $username with the css font. :)

4

1 回答 1

1

您需要输出适合<link>您的 CSS 的 HTML。

例如:_

<?php
$username = 'Bob';

echo <<<EOT
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>My Title</title>
    <link rel="stylesheet" href="mystyles.css">
</head>

<body>
$username
</body>
EOT;
?>
于 2013-06-29T08:03:58.923 回答