How to apply CSS setting to specific HTML element -


html:

        <div class="tagline">web portal name</div><br />         <div id="logged_in_user_dtls" style="color:#fff; margin-top:15px; font:bold; width:100%; position:relative; margin-left:800px;float:left;">        <span> welcome <?php echo $_session['username'] ?> </span>        | <a href="login.php"><span> sign out</a> </span> </div> 

in web templete, i'm displaying logged in user name followed welcome message.

problem: when user name long(approx 30 char) next link (sign out link), moved right hand side.

how can avoid moving sign out link right. know may have simple answer unable figure out.

note: tried change marigin-left setting, spoiling alignment.

update: can keep sign out link's position fixed, irrespective of user name lenght?

set max-width long names , put ellipsis show this:

<span class="username"> welcome <?php echo $_session['username'] ?> </span> 

css

.username  {     overflow: hidden;     text-overflow: ellipsis;     white-space: nowrap;     display: inline-block;     max-width: x px; /* set need */ } 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -