Jump to content

Position help


Monk3h

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.