Putting something to the side |
Putting something to the side |
spadez |
Oct 7 2006, 05:43 PM
Post
#1
|
Newbie Group: Members Posts: 16 Joined: 30-September 06 Member No.: 295 |
Im trying to put a CSS box to the right of another box but it keeps putting it under it. This is my code:
CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>MOTD</title> <style type="text/css" media="screen"><!-- body { color: white; background-image:url('http://www.hiven.net/files/background.jpg') } #content { font-family: Verdana, Geneva, Arial, sans-serif; background-color: #FFFFFF; display: table-cell; visibility: visible; position: absolute; border-width: 1px; border-color: black; } #content2 { font-family: Verdana, Geneva, Arial, sans-serif; position: absolute; color: black; } #content3 { font-family: Verdana, Geneva, Arial, sans-serif; background-color: #FFFFFF; display: table-cell; visibility: visible; position: absolute; border-width: 1px; border-color: black; height : 192px; repeat-x; } .bodytext { font-size: 10px; color: #000000 } .headline { font-weight: bold; font-size: 24px } a:link, a:visited { color: #000000; text-decoration: none } a:hover { color: red; text-decoration: none } .captions { color: white; font-size: 10px; line-height: 14px; font-family: Verdana, Geneva, Arial, sans-serif; text-align: left } #header { background: #000000 url(http://www.hiven.net/forums/images/gradients/gradient_tcat.gif) repeat-x; height: 25px } #header2 { background: #000000 url(http://www.hiven.net/files/header2.gif) repeat-x; height: 20px } </style> </head> <body> <div id="header"><img src="http://www.hiven.net/files/motdhg.gif" alt="Header" /></div><div id="header2"><a href="http://www.hiven.net/files/motd2.php"><img src="http://www.hiven.net/files/home.gif" alt="Home" border="0"></a><a href="http://www.hiven.net/files/stats.php"><img src="http://www.hiven.net/files/stats.gif" alt="Stats" border="0"></a><a href="http://www.hiven.net/files/ranks.php"><img src="http://www.hiven.net/files/ranks.gif" alt="Ranks" border="0"></a><a href="http://www.hiven.net/files/music.php"><img src="http://www.hiven.net/files/music.gif" alt="Music" border="0"></a><a href="http://www.hiven.net/files/rules.php"><img src="http://www.hiven.net/files/rules.gif" alt="Rules" border="0"></a><a href="http://www.hiven.net/files/apply.php"><img src="http://www.hiven.net/files/apply.gif" alt="Apply" border="0"></a></div><div id="content2"></div> <br /> <div id="content"> <div class="bodytext"> <B><center>LATEST POSTS</center></B> <?php $db_host = "**"; // Change this if your MySQL database host is different. $db_name = "**"; // Change this to the name of your database. $db_user = "**"; // Change this to your database username. $db_pw = "**"; // Change this to your database password. $db_prefix = "***"; //Change this to the prefix of the forum database. $forum_url = "http://www.hiven.net/forums"; // Change this to reflect to your forum's URL. $limit = "10"; // Number of posts displayed. $txtlimit = "22"; // This is the character limit. // Connecting to your database mysql_connect($db_host, $db_user, $db_pw) OR die ("Cannot connect to your database"); mysql_select_db($db_name) OR die("Cannot connect to your database"); if ($limit) { $limited = "LIMIT $limit"; } $thread_sql = mysql_query("select threadid,title,lastpost,firstpostid from $db_prefix thread where visible=1 $wheresql and open=1 $forumid order by lastpost desc $limited"); while($thread_get = mysql_fetch_array($thread_sql)) { $lastpost = $thread_get['lastpost']; $tid = $thread_get['threadid']; $psql = mysql_query("SELECT postid from $db_prefix post where threadid=$tid order by postid desc"); $getp = mysql_fetch_array($psql); $pid = $getp['postid']; $title = $thread_get['title']; $title = substr($title,0,$txtlimit); echo "<li class=\"item\"><a href=\"$forum_url/showthread.php?p=$pid#post$pid\"><span>$title</span></a></li>"; } ?> </div> </div> </body> </html> Im trying to put this code somewhere: CODE <div id="content">Testing</div> So hopefully it will look like this: (It looks like this atm: http://www.hiven.net/files/motd2.php) This post has been edited by spadez: Oct 7 2006, 05:45 PM |
Peter1968 |
Oct 9 2006, 03:47 AM
Post
#2
|
Serious Coder Group: Members Posts: 448 Joined: 23-September 06 Member No.: 213 |
Try using clear: left in #content
Be advised that display: table-cell has somewhat marginal support. http://www.quirksmode.org/css/display.html This post has been edited by Peter1968: Oct 9 2006, 03:49 AM |
Lo-Fi Version | Time is now: 29th March 2024 - 05:53 AM |