Announcement DIV breaking other divs.

Discussion in 'HTML & Website Design' started by X.Homer.X, Nov 7, 2007.

  1. #1
    This could go in either html and css, but its more of an html problem than a css i would think :S

    ----

    Okay, so on my site, i have a side box that changed when you login or logout.

    Taht works fine, but i have an announcement div, that i want to display with a custom message.

    When i put <div id="announcement">Hello peoples!</div>

    it breaks apart the other divs.

    heres my announcement div.
    
    #announcement { 
      width: 139px;
      border: solid #3636FF 1px;
      padding: 4px;
      text-align: center;
      background-color: #DADAFF;
      font-size: 10px;
      font-family: arial; 
    }
    
    Code (markup):
    and heres my login box
    
    	<div id="main_box">
    	<h2>&raquo; <?php
    	echo $login_title;
    	?> </h2>
    	<p class="center">
    <?php
    if($logged == 1)
    {
      echo $date;
    ?></p>
    <div id="announcement">Hello Peoples!</div>
    <p><?php
      echo $login;
    }
    else
    {
      echo $login;
    }
    ?>
    	</p>
    	</div>
    
    Code (markup):
    anyone know what could be wrong?
     
    X.Homer.X, Nov 7, 2007 IP
  2. jBud

    jBud Peon

    Messages:
    387
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it's kind of hard to see what it is without actually seeing the whole code,
    it could be something really simple as a float or position error.
     
    jBud, Nov 7, 2007 IP
  3. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    maybe a live link would help?
     
    bobb1589, Nov 7, 2007 IP
  4. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #4
    1. Are you using a universal reset? If not, google it.
    2. Remove the padding from that and use margins for the elements inside (#announcement)
     
    soulscratch, Nov 7, 2007 IP
  5. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Maybe the announcement div is to wide?

    But as the others say - without seeing the page in question, you wont get a proper answer.
     
    webdesigner, Nov 7, 2007 IP
  6. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i am using a universal reset, and the webpage in question is http://bobbanation.freehostia.com (i thought i provided this link in the first post. sorry)
    you can view source to see whats going on, or i will give you a little snapshot of what is going on

    
    <div id="main_box">
    	<h2>» Welcome Homer! </h2>
    	<p class="center">
    Thursday, November 8, 2007</p><div id="announcement">Hello people!</div>
    <a href="/forum/ucp.php?i=pm&folder=inbox&sid=2a23c630ecdb37e495b04f4ac1f0bff0">Inbox (0)</a> | <a href="forum/ucp.php?mode=logout&sid=2a23c630ecdb37e495b04f4ac1f0bff0">Logout</a>	
    	</div>
    
    Code (markup):
     
    X.Homer.X, Nov 7, 2007 IP
  7. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sorry, also you need to login, use these credentials
     
    X.Homer.X, Nov 8, 2007 IP
  8. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #8
    A link to the actual file would be helpful, not the directory listing of folders.
     
    webdesigner, Nov 8, 2007 IP
  9. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    X.Homer.X, Nov 8, 2007 IP