Monk3h Posted August 9, 2009 Share Posted August 9, 2009 I have created a roll over efect using CSS within PHP. However when i print out what i want it appears one above the other instead of side by side. I have not used any <BR> or <P> Very confused. Code is below, all help greatly appreciated! <?php $homepage = "index.php"; if($homepage==$currentpage) { Print "<img src='images/rollovers/homemouse_01.png' width='100' height='30'>"; }else{ Print"<div class='rollover'> <a href='#'><img src='images/rollovers/home_01.png' width='100' height='30' border='0'></a> </div>"; } $workpage = "work.php"; if($workpage==$currentpage) { Print "<img src='images/rollovers/workmouse_01.png' width='100' height='30'>"; }else{ Print"<div class='rollover'> <a href='#'><img src='images/rollovers/work_01.png' width='100' height='30' border='0'></a> </div>"; } ?> Example is here, http://riseofkingdoms.net/portfolio/4/work.php Quote Link to comment https://forums.phpfreaks.com/topic/169455-position-help/ Share on other sites More sharing options...
haku Posted August 10, 2009 Share Posted August 10, 2009 Show us the html output. The php is irrelevant. Quote Link to comment https://forums.phpfreaks.com/topic/169455-position-help/#findComment-894496 Share on other sites More sharing options...
BLaZuRE Posted August 10, 2009 Share Posted August 10, 2009 Your css for the mouseover is commented out. Anyway, why are you using inline-block instead of inline? div's are block elements, so I don't see a point setting it to display as inline-block. Plus, you already set all div's to have their content inline. (using display: inline means that the content INSIDE the div will be inline, NOT the actual div itself; you can solve this by having a container div with the inline style, meaning all the content inside the container div, including other divs, will be inline) Also, using align="..." for HTML tags is deprecated, align using CSS instead. When viewing your source code, it seems like your css is either directly with the rest of your code or you're using PHP includes. Use the <link> tag instead to attach stylesheets to your page. Finally, you should be using a strict doctype, not transitional. Strict further assures your page will be cross-browser compatible. Transitional is really only for webpages that are preserved (some old, deprecated HTML tags can still be used, until browsers stop enforcing them) or for people that don't care about writing good code. Quote Link to comment https://forums.phpfreaks.com/topic/169455-position-help/#findComment-894513 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.