chanfuterboy Posted August 17, 2009 Share Posted August 17, 2009 hi, echo 1 to 3, need to be center, and echo 4 need to be right, they are in the same line. how i can put it without use-ing i try <td> also but seems not getting it help me echo "<p align='center'>[<a href='profile.php' target='mFrame'>Profile</a>] "; echo "[<a href='profile.php' target='mFrame'>P.M</a>] "; echo "[<a href='profile.php' target='mFrame'>Add Friends</a>] "; echo "Welcome, ".$_SESSION['username']. "[<a href='logout.php'>Logout</a>]"; Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted August 18, 2009 Share Posted August 18, 2009 well start off trying to use divs to place your information example <div id="main_content"> <div id="center" style="align:center"><?=echo "<p align='center'>[<a href='profile.php' target='mFrame'>Profile</a>] ";?></div> <div id="center" style="align:center"><?=echo "<p align='center'>[<a href='profile.php' target='mFrame'>Profile</a>] ";?></div> <div id="center" style="align:center"><?=echo "[<a href='profile.php' target='mFrame'>Add Friends</a>] ";?></div> <div id="right_side" style="float:right"><?=echo "Welcome, ".$_SESSION['username']. "[<a href='logout.php'>Logout</a>]";?></div> </div> Quote Link to comment Share on other sites More sharing options...
trq Posted August 18, 2009 Share Posted August 18, 2009 well start off trying to use divs to place your information example <div id="main_content"> <div id="center" style="align:center"><?=echo "<p align='center'>[<a href='profile.php' target='mFrame'>Profile</a>] ";?></div> <div id="center" style="align:center"><?=echo "<p align='center'>[<a href='profile.php' target='mFrame'>Profile</a>] ";?></div> <div id="center" style="align:center"><?=echo "[<a href='profile.php' target='mFrame'>Add Friends</a>] ";?></div> <div id="right_side" style="float:right"><?=echo "Welcome, ".$_SESSION['username']. "[<a href='logout.php'>Logout</a>]";?></div> </div> You cannot have multiple divs all with the same id. Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted August 18, 2009 Share Posted August 18, 2009 weird i do and it works perfectly haha Quote Link to comment Share on other sites More sharing options...
haku Posted August 18, 2009 Share Posted August 18, 2009 It's invalid code. It's also divitis - there is no reason for that many divs at all. One div wrapping all of those <p> tags is enough. If each <p> tag needs to be styled separately, it can be given it's own class. And finally, making an ID or class name be a description of the styling is not a good practice, as at some point in the future, the styling may change. For example, the three p tags that are left aligned may need to be switched to a right alignment at some time, at which point having an ID or class named 'left' doesn't make a lot of sense. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.