Jump to content


Photo

php html css and empty div space


  • Please log in to reply
5 replies to this topic

#1 laponac84

laponac84

    Member

  • Members
  • PipPip
  • 13 posts

Posted 29 January 2013 - 09:00 AM

This is basic template for soccer manager
http://sportskevesti...creenshot_1.png

this is the code ( #telo is white space below the menu, #glavno is left blue part, #desno is right blue part)
<div id="telo">
   <div id="glavno">
   </div>
   <div id="desno">
   </div>
</div>

#telo{
width: 1000px;
overflow: hidden;
float: left;
}
#glavno{
width: 650px;
overflow: hidden;
height:350px;
background-color: #336699;
float: left;

padding: 0px;
margin: 10px 0px 0px 0px;
}

#desno{
width: 340px;
min-width: 340px;
min-height: 350px;
overflow: hidden;

background-color: #336699;
float: left;

margin: 10px 0px 0px 10px;

}
And, this is OK for now.

But... when i put some code in template for GET session and GET option for dinamic webpage i have problem with empty blu space in #glavno, between the top border, and div inside the #glavno
example:
http://sportskevesti...creenshot_2.png
as you see, i have empty blue space in #glavno, and that is not ok...i nead TIM1 div to bi in line with top border #glavno

this is code
<div id="glavno">
	 <?php 
	  if(!empty($sessija)){
	    switch ($opcija) {
        case "moj-tim":
		  include("modul/mod_moj_tim/index.php");
		  break;
        //rest of case....
	    }
	  }
	  elseif(empty($sessija)){
        // no session code...
	    }
	  
	  }
	 ?>
    </div>


file: modul/mod_moj_tim/index.php
<div id="liga">
<?php echo strtoupper($naziv); ?>
</div>

liga{

background-color: #131313;
overflow: hidden;
float: none;

width: 650px;
padding:10px;

margin-top:0px;

color: #ffffff;
font-size: 16px;
border-style:solid; border-width: 0px 0px 1px 0px; border-color: #a1a1a1;
}

Where is the problem, and what to do?
Thanks :)

#2 thara

thara

    Advanced Member

  • Members
  • PipPipPip
  • 423 posts
  • LocationPanda

Posted 29 January 2013 - 11:57 AM

Not sure what is your problem here. If it is top margin in your #glavno div remove margin property and its value from CSS...

margin: 10px 0px 0px 0px;

IT consultation and Integration : Web Design and Web Development.

#3 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 366 posts
  • LocationThe Pleiades
  • Age:23

Posted 30 January 2013 - 01:51 AM

Have you got a live version? Would be a lot easier to debug.

You see the text 'TIM 1', what element is that? If it's a <p> element, try giving it a margin-top: 0px; because <p> elements have a default margin.

Kind regards,

L2c.

#4 jardrake

jardrake

    Member

  • Members
  • PipPip
  • 17 posts

Posted 30 January 2013 - 11:56 PM

Have you checked to see if there is any padding in the glavno or a margin in the inner div of the glavno?

#5 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 366 posts
  • LocationThe Pleiades
  • Age:23

Posted 31 January 2013 - 12:57 AM

Not sure what is your problem here. If it is top margin in your #glavno div remove margin property and its value from CSS...

margin: 10px 0px 0px 0px;


This would set the margin-top to 10 pixels.

The shorthand CSS for margins is like this:
margin: top right bottom left;

edit: sorry I realize now you were identifying the CSS for him.

Regards,

L2c.

Edited by Love2c0de, 31 January 2013 - 01:07 AM.


#6 laponac84

laponac84

    Member

  • Members
  • PipPip
  • 13 posts

Posted 06 February 2013 - 11:34 AM

I understand and know how to do that, unfortunately, problem was in Easy PhP. When i upload my example on internet server, all css code work ok.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com