简体   繁体   中英

html align text with value in a line

I'm creating a simple fake forum for a class project. It works exactly like a normal forum where you can post topics, comment, ect.. But when you are at the main forum page (bellow) there is text that says signed in as and then your username but the username is not right next to the text on one line like i want it to be. How can I merge them together?

img

This is the code for that line

<form align="right" id="name_disp">
    <div>
        <p id="SIA">signed in as </p>
        <a style="color:blue"id="userNAME" onclick="showProfile(this.innerHTML)">hahn2014</a>
        <input type="button" value="Sign Out" onClick="logOut()" style="width: 65px; height: 25px">
    </div>
</form>

Instead of <p> </p> use <span></span> like this :

<span id="SIA">signed in as </span>
<a style="color:blue"id="userNAME" onclick="showProfile(this.innerHTML)">hahn2014</a>

JSFIDDLE : http://jsfiddle.net/y9Gje/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM