Page 1 of 1

OMG DIVS lmao

Posted: Sun Nov 02, 2014 9:46 pm
by Epiales
I know someone is going to laugh their butts off here, but I've spent a few hours and I can't find what is freakin' wrong with the lining up of the health/experience bars. I see nothing wrong in the code:

Code: Select all

<style>
#stats {
    margin-left:305px;
    background:url(../images/bg.png);
    width:200px;
    height:170px;
    font:bold Arial, Helvetica, sans-serif;
    color:rgb(255, 255, 255);
    color:white;
}

#hpointsback {
    position:relative;
    margin-left:10px;
    z-index:1;
}

#hpoints {
    position:relative;
    margin-left:10px;
    z-index:2;
}

#expback {
    position:relative;
    margin-left:10px;
    z-index:1;
}

#experience {
    position:relative;
    margin-left:10px;
    z-index:2;
}
</style>

Code: Select all

<!-- THIS IS THE HEALTH BAR CODE-->
<?php
$username = $_SESSION["username"];
$sql = "SELECT * FROM users WHERE username='$username' AND activated='1' LIMIT 1";
$user_query = mysqli_query($db_conx, $sql);
// Now make sure that user exists in the table
$numrows = mysqli_num_rows($user_query);
$row = mysqli_fetch_array($user_query, MYSQLI_ASSOC);
?>

<!-- THIS IS THE HEALTH BAR CODE-->
<div id="stats">
    <div id= "hpointsback">
    <?php
    echo "<img src='images/barback1.png'>";
    ?>
    </div>
    <div id= "hpoints">
<?php
$width = ($row['hpoints'] / $row['maxhp']) * 150;
echo "<img src='images/hpoints1.png' width='$width' height='10'>";
?>

<!-- THIS IS THE EXPERIENCE BAR CODE-->
    </div>
    <div id= "expback">
    <?php
    echo "<img src='images/barback1.png'>";
    ?>
    </div>
    <div id= "experience">
<?php
$width = ($row['userexp'] / $row['maxexp']) * 150;
echo "<img src='images/experience.png' width='$width' height='10'>"; ?>
    </div>
</div>
I had everything out of whack on my previous work, I had to start over, and now can't get the bars to hover over one another to make it a progress bar.

EDIT*****************

I also didn't put any margin-top to line them up on top of one another, because it doesn't work. All they do is just go right under one another... they will not overlap grrrr :twisted:

Re: OMG DIVS lmao

Posted: Mon Nov 03, 2014 3:08 am
by Epiales
LOL, I just NOW figured it all our again... grrr. :P :P :P :P :P

Re: OMG DIVS lmao

Posted: Mon Nov 03, 2014 4:58 am
by Jackolantern
Good! Did that jQuery answer in your other thread help?

Re: OMG DIVS lmao

Posted: Mon Nov 03, 2014 5:02 am
by Epiales
Jackolantern wrote:Good! Did that jQuery answer in your other thread help?
haven't tried to implement it yet, as I have redone things. I will let you know. I'm sure it will though. I"m fighting with making the divs stay in place upon scrolling screen. It all goes out of whack now lmao... it does that to me everytime I try and do anything.