PHP: How to style session output [closed]


Tags: php,css,session,styles

Problem :

I have this PHP code:

<?php
session_start();
if (!empty($_SESSION['username'])) {
?>
    Welcome, <?= $_SESSION['username'] ?>
    <br>
    <a href='mcLogout.php'>Logout</a>
<?php
} else {
?>
    <p class="da">Don't have an account?</p>
    <p><a class="lr" href='registrationpage.php'>Register Here</a></p>
<?php
}
?>

The code is display the username of the user who is in the session (logged) and a link to log out. I wish to know how can I give a style to the username using CSS i.e:

"Welcome, <?=$_SESSION['username']?>"

This part of the code.



Solution :

what ever comes between wihle echoing are just like any other HTML element.

<h1>" Welcome, " <?= $_SESSION['username'] ?></h1>

or

Welcome, <h1 class="username"><?= $_SESSION['username'] ?></h1>

    CSS Howto..

    How to prevent ALT text showing on cursor hover over image?

    How to remove/add jQueryUI CSS theme from specific element?

    How may I stack multiple html/css buttons vertically along the center of the page?

    diagonal lines as background for css - how to switch angle

    Mapbox GeoJSON loaded via local URL: icons not showing popup properties

    How to edit the CSS of CarrierWave's 'Choose file' button and “No file chosen” text? (Rails4)

    How to find a first td in a tr using tr class name in CSS? [duplicate]

    In CSS: how to specify the font you want as being BOTH monospace and sans-serif?

    CKEditor 4: How to add CSS stylesheet from plugin?

    OS X is messing with me css, how to fix

    How to vertically align data in the center of a table cell in HTML?

    how can i change the css style on click with table

    Should I turn these images into a sprite, and if so, how would I do so? (picture included)

    How do I change the MVC Bootstrap layout to have more than one columns

    How to create this CSS border

    How is it possible to align css sprites horizontally?

    Something in my CSS is causing a random white bar to appear, how do I fix it?

    How can I set the Eclipse JS to edit a file as CSS

    Bootstrap CSS - How do I keep the search form inline with other navbar elements?

    CSS select + select How to get first select

    How can I add a coloured square in front of several list items?

    How to define the css :focus state in a jQuery selector?

    How come I keep getting a Failed to load resource: Error everytime I run my applacation?

    CSS: How to make background color around text not flush to the text?

    How can design a full screen calendar view in Twitter Bootstrap?

    how to apply vertical-align: middle at div

    How to add specific CSS attributes to all text-containing elements

    How to use CSS to place text on different sizes of images?

    how to make background 100% on a top menu

    PHP & CSS: How to get hover effect for each row of a table?