Need help with my website design (HTML/CSS)

Discussion in 'HTML & Website Design' started by lokielookies, Feb 14, 2009.

  1. #1
    My site has been designed using HTML and tables, mainly because I'm too new to CSS to make it entirely CSS based.

    My page looked good, until I plugged in my PHP code, so I decided to try to style it further using css.

    Unfortunately, there are some things I just can't get right and now I'm looking for some help.




    My problems:

    • The top part is a little more to the left than the rest of the page and I can't seem to align it so the images fit.
    • The list of keywords should be displayed (and fit) in the square.
    • The generated status (click a keyword to see it), should be displayed inside the speech bubble.


    All help will be highly appreciated!

    ;)
     
    lokielookies, Feb 14, 2009 IP
  2. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Someone can Help if you provide the CODE which you have used for that page..

    What I suggest you is:
    1) Save the webpage which is loaded to the browser from internet.
    2) Open it with your Editor and format it to your needs
    3) Compare it with your PHP version and you will come to know where to problem might have occured..
    4) You may fix it for yourself if you are able to recognize where the mistake has happened..

    You may need to implement CSS properly to the places where the PHP Data gets displayed on the page..
    Or
    You may have used some formatting in the source of that PHP data which is getting displayed on this page and you may need to edit the source..
     
    kslokesh, Feb 14, 2009 IP
  3. lokielookies

    lokielookies Well-Known Member

    Messages:
    1,246
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    150
    #3
    For some reason, I can't get the tags to show in a proper square, instead of one below the other.

    In my index.php file:

    
    <?
    //MAIN FUNCTION
    include('showtag.php');
    ?>
    PHP:
    showtag.php:
    
    <?
     $query = "SELECT * FROM tblquotes ORDER BY RAND()";
     $result = mysql_query($query) or die(mysql_error()); 
     if ($result && MySQL_num_rows($result)>0)
     {
      $alltags[]="";
      $count=0;
      $maxcount = readvar('number');
      $fsize1 = readvar('fsize1');
      $fsize2 = readvar('fsize2');
      while($row = MySQL_fetch_array($result))
      {
       $tags = $row["tags"];
       $tagsx = explode(",",$tags);
       {if ($maxcount>0 && $count>=$maxcount) {break;}
        foreach ($tagsx as $key => $value)
        {
         $value = strtolower(trim($value));
         if ($value)
         {
          if (!array_search($value,$alltags))
          {
           $alltags[]=$value;
           $count++;
           if ($maxcount>0 && $count>=$maxcount) {break;}
          }
         }
        }
       }
      }
     }
    
     foreach($alltags as $key => $value)
     {
      while ($fontsize==$fontsizex) {$fontsize=rand($fsize1,$fsize2);}
      echo "[B]<div id=\"showtags\">[/B]<a class=\"cloudhyperlink\" href=\"?tag=".urlencode($value)."\"><font class=\"cloudfont\" size=\"$fontsize\">$value</font></a>&nbsp;&nbsp;&nbsp;</div>";
      $fontsizex = $fontsize;
     }
    ?>
    PHP:

    My CSS:

     
    lokielookies, Feb 15, 2009 IP
  4. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #4
    I am a very beginner web designer.. I dont know to code PHP but I can understand the code a bit..

    You are using DIV code for displaying the TAGS..

    1)
    <b><div id=\"showtags\" ></b>
    Code (markup):
    - Why Ending the BOLD Tag just after begining the DIV Tag? Proper Nesting of the Tags is needed..

    2) I think its taking DIV for each and every TAG.. So they are getting displayed on separate lines..
    Use SPAN Tag instead of DIV..
    <span id=\"showtags\"><b><a class=\"cloudhyperlink\" href=\"?tag=".urlencode($value)."\"><font class=\"cloudfont\" size=\"$fontsize\">$value</font></a></b>&nbsp;&nbsp;&nbsp;</span>
    Code (markup):
    Nest the HTML Tags in a Proper manner..

    Try it and see..
     
    kslokesh, Feb 16, 2009 IP
  5. ExtremeData

    ExtremeData Well-Known Member

    Messages:
    450
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #5
    Just a suggestion, more easy is to make a .php page with vars functions etc and use them just when you need not to put all html content into php.
    To undrerstand what I mean I'll show you a little code.
    Why to use :
    
    <?php echo "[b]<div id=\"showtags\">[/b]<a class=\"cloudhyperlink\" href=\"?tag=".urlencode($value)."\"><font class=\"cloudfont\" size=\"$fontsize\">$value</font></a>&nbsp;&nbsp;&nbsp;</div>"; ?>
    
    Code (markup):
    When you can use :

    
    <div id="showtags">
    <a class="cloudhyperlink" href="<?php echo urlencode($value); ?>">
    <font class="cloudfont" size="<?php echo $fontsize; ?> ">
    <?php echo $value; ?>
    </font>
    </a>
    </div>
    
    PHP:
     
    ExtremeData, Feb 16, 2009 IP
  6. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #6
    Good Suggestion ExtremeData..

    In first code, You are using DIV tag within echo to display $value and its resulting showing all the Tags in new line I think..

    In second code, you have place echo within DIV tag.. So this will result in placement of tags in a single line or multiple lines depending of the width of the DIV..

    I think this will solve the problem.. Lets see what will lokielookies say ?
     
    kslokesh, Feb 16, 2009 IP