Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
div boundary problem!
Old 11-24-2008, 08:18 PM div boundary problem!
digitalfusion's Avatar
Skilled Talker

Posts: 73
Name: Martin
Location: Fife, Scotland
Trades: 0
Hi All,

The problem i'm having is on the following website:
http://www.tazzyserver.co.uk/

In IE the tag cloud div in the sidebar is extending far too wide and causing the whole layout to mess up.

In Firefox the tag cloud content just seems to ignore the div boundaries and float out over everything.

I have tried everything to get it work from setting the divs widths, margins the lot.

My CSS is as follows:

Code:
/* Sidebar Start */
#sidebar {
    float: right;
    position: relative;
    width: 225px;
    margin-top: 0.5em;
    margin-left: 0;
    margin-right: 0.5em;;
    margin-bottom: 0;

    font-family: Verdana;
    font-stretch: expanded;
    font-size: 14px;
    color: #666666;
}

.tagcloud {
    width: 100%;
    max-width: 200px;
    margin: auto;
    padding: 2px 2px 2px 2px;
    background-color: #E3E5E9;
    border: 1px solid #DDDDCA;
}

#cprojects {
    background-color: #FFFFFF;
    color: #666666;
    padding-top:0.5em;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 0.5em;
}


#cprojects-header {
    background: url('images/cprojects-header.gif') repeat-x;
    
    padding: 5px 5px 5px 5px;
    font-size: 16px;
    font-family: verdana;
    font-stretch: extra-expanded;
    color: #ffffff;
    bottom: 0;
    margin: 0 0 0 0;
}

#lnews {
    border: 2px solid #DDDDCA;
    background-color: #FFFFFF;
    color: #666666;
    padding-top:0.5em;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 0.5em;
}


#lnews-header {
    background: url('images/login-header.gif') repeat-x;
    border: 1px solid #DDDDCA;
    padding: 5px 5px 5px 5px;
    font-size: 16px;
    font-family: verdana;
    font-stretch: extra-expanded;
    color: #ffffff;
    bottom: 0;
    margin: 0 0 0 0;
}

#cats {
    border: 2px solid #DDDDCA;
    background-color: #FFFFFF;
    color: #666666;
    padding-top:0.5em;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 0.5em;
}


#cats-header {
    background: url('images/login-header.gif') repeat-x;
    border: 1px solid #DDDDCA;
    padding: 5px 5px 5px 5px;
    font-size: 16px;
    font-family: verdana;
    font-stretch: extra-expanded;
    color: #ffffff;
    bottom: 0;
    margin: 0 0 0 0;
}

#logindiv {
    border: 2px solid #DDDDCA;
    background-color: #FFFFFF;
    color: #666666;
    padding-top:0.5em;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
    margin-top: 0;
}

#login-header {
    background: url('images/login-header.gif') repeat-x;
    border: 1px solid #DDDDCA;
    padding: 5px 5px 5px 5px;
    font-size: 16px;
    font-family: verdana;
    font-stretch: extra-expanded;
    color: #ffffff;
}
and my html is as follows:

HTML Code:
<!-- start of sidebar content -->

        <div id="lnews-header"><strong>Member Login </strong></div>
        <div id="lnews">
        <?php
        // check to see if the user is logged in already
    if($loggedin=='true') {
        // the user is logged in, show user menu


        //Here we define out main variables
        $welcome_string="Welcome,";
        $numeric_date=date("G");
        
        //Start conditionals based on military time
        if($numeric_date>=0&&$numeric_date<=11)
        $welcome_string="Good Morning,";
        else if($numeric_date>=12&&$numeric_date<=16)
        $welcome_string="Good Afternoon,";
        else if($numeric_date>=17&&$numeric_date<=23)
        $welcome_string="Good Evening,";
        
        //Display our greeting
        echo "".$welcome_string." ".$username."!<br />";

        if($userrank=='Admin') {
        include('includes/admin_usermenu.php');
        } else {
        include('includes/usermenu.php');
        }
    } else {    
        // the user isn't logged in, show login form
        ?>
        <form action="login.php" method="post" enctype="multipart/form-data" name="loginform" id="loginform">
          <p>Username 
            <input name="username" id="username" type="text" />
        Password 
        <input name="userpass" id="userpass" type="password" />
        <br />
        <br />
        <input name="submit"  type="submit" value="Login" />
        </p>
          <p><a href="register.php">Register</a> | <a href="reminder.php">Forgotten Login</a> </p>
        </form>
        <?php
    }
    ?>
        </div>
    
    <div id="cats-header"><strong>Categories</strong></div>
        <div id="cats">
        <?php
        $getcats=mysql_query("SELECT * FROM blog_post_cats ORDER BY postcatname ASC");
        while($cat=mysql_fetch_array($getcats, MYSQL_ASSOC)) {
        $postcount=mysql_query("SELECT * FROM blog_posts WHERE postcatid='".$cat['postcatid']."'") or die(mysql_error());
        $count=mysql_num_rows($postcount);
            echo "<a href='viewcat.php?catid=".$cat['postcatid']."'>".$cat['postcatname']." (".$count.")</a><br />";
        }
        ?>
        </div>
        
        <div id="cats-header"><strong>Search</strong></div>
        <div id="cats">
          <form action="search.php?action=process" method="post" enctype="multipart/form-data" name="search" id="search">
            <label>
            <input name="keywords" type="text" id="keywords" />
            <br />
            <br />
            <input type="submit" name="Submit" value="Search" />
            </label>
                              </form>
        </div>
        <div id="cats-header"><strong>Tag Cloud</strong></div>
        <div id="cats">
                              <?php
                              include('includes/tagcloud.php');
                              ?>
        </div>
    </div>
    <!-- end of sidebar content -->
The content of tagcloud.php is:
PHP Code:
echo "<div class='tagcloud'>";
// get tags from database
$gettags=mysql_query("SELECT * FROM blog_tags");
while(
$tag=mysql_fetch_array($gettagsMYSQL_ASSOC)) {
    
// output tagcloud, vary font size depending on tagcount
    
$tagcount="".$tag['tagcount']."";
    
$tagname="".$tag['tag']."";
    
$tagid="".$tag['tagid']."";
    if(
$tagcount<=5) {
        echo 
"<span style='font-size: 14px; margin: 2px 2px 2px 2px;'><a href='search.php?action=tag&tagid=".$tagid."'>".$tagname."</a>&nbsp;</span>";
    } else if(
$tagcount>=5&&$tagcount<=10) {
        echo 
"<span style='font-size: 18px; margin: 2px 2px 2px 2px;'><a href='search.php?action=tag&tagid=".$tagid."'>".$tagname."</a>&nbsp;</span>";
    } else if(
$tagcount>=10&&$tagcount<=20) {
        echo 
"<span style='font-size: 20px; margin: 2px 2px 2px 2px;'><a href='search.php?action=tag&tagid=".$tagid."'>".$tagname."</a>&nbsp;</span>";
    }
    
}
echo 
"</div>"
Any help would be greatly appreciated as this is really frustrating hehe

Kind Regards,
Martin
__________________
---------------------------------------------------

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by digitalfusion; 11-24-2008 at 08:20 PM.. Reason: Forgot to include tagcloud.php contents
digitalfusion is offline
Reply With Quote
View Public Profile Visit digitalfusion's homepage!
 
 
Register now for full access!
Old 11-24-2008, 08:23 PM Re: div boundary problem!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
get rid of the &nbsp; in the empty "tags" they are doing EXACTLY what they are supposed to!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-25-2008, 06:44 AM Re: div boundary problem!
digitalfusion's Avatar
Skilled Talker

Posts: 73
Name: Martin
Location: Fife, Scotland
Trades: 0
Quote:
Originally Posted by chrishirst View Post
get rid of the &nbsp; in the empty &quot;tags&quot; they are doing EXACTLY what they are supposed to!
Thanks for your comment I have tried removing them and nothing changes, i thought they only added a space after the link so to seperate each of the tags?? Its like content just doesn't know where to stop. Any help would be greatly appreciated. Kind Regards, Martin
__________________
---------------------------------------------------

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
digitalfusion is offline
Reply With Quote
View Public Profile Visit digitalfusion's homepage!
 
Old 11-25-2008, 07:38 AM Re: div boundary problem!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
&nbsp; adds a Non-BreakingSPace which make a line of text which has no places to break at element boundaries, so yes, it doesn't "know" where to stop.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-25-2008, 08:05 AM Re: div boundary problem!
digitalfusion's Avatar
Skilled Talker

Posts: 73
Name: Martin
Location: Fife, Scotland
Trades: 0
Quote:
Originally Posted by chrishirst View Post
&nbsp; adds a Non-BreakingSPace which make a line of text which has no places to break at element boundaries, so yes, it doesn't "know" where to stop.
Thanks for your help i have managed to get it working by simply adding a line beneath each in the code, it seems to have done the trick.

tagcloud.php
PHP Code:
<?php
///////////////////////////////////
/* Script Name: tagcloud.php
   Author: Martin Lainh
   Website: www.martinlaing.co.uk
   Copyright (c) 2008 Martin Laing
*/
///////////////////////////////////

// get tags from database
$gettags=mysql_query("SELECT * FROM blog_tags");
while(
$tag=mysql_fetch_array($gettagsMYSQL_ASSOC)) {
    
// output tagcloud, vary font size depending on tagcount
    
$tagcount="".$tag['tagcount']."";
    
$tagname="".$tag['tag']."";
    
$tagid="".$tag['tagid']."";
    if(
$tagcount<=4) {
        echo 
"<a style='font-size: 14px;' href='search.php?action=tag&tagid=".$tagid."'>".$tagname."&nbsp;</a>
        "
;
    } else if(
$tagcount>=5&&$tagcount<=9) {
        echo 
"<a  style='font-size: 18px;' href='search.php?action=tag&tagid=".$tagid."'>".$tagname."&nbsp;</a>
        "
;
    } else if(
$tagcount>=10&&$tagcount<=20) {
        echo 
"<a   style='font-size: 22px;' href='search.php?action=tag&tagid=".$tagid."'>".$tagname."&nbsp;</a>
        "
;
    }
    
}

?>
Kind Regards,
Martin
__________________
---------------------------------------------------

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
digitalfusion is offline
Reply With Quote
View Public Profile Visit digitalfusion's homepage!
 
Old 11-27-2008, 07:34 PM Re: div boundary problem!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Same difference, you are inserting "white space" that allows the line to "break"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to div boundary problem!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31809 seconds with 12 queries