Jump to content

percentage widths problem!!


adamhhh

Recommended Posts

right this has been bugging me for a few days now,

 

ive played around with a lot of sites and when you resize the browser (assuming their using % widths rather than absolute) the divs get smaller but dont go down the page etc as my page is doing..

 

http://www.studybot.net/studentsite/index2.php

 

here this is a header div with 2 divs inside. When i reduce the browser window eventually the logo2 div goes outside the header div rathern than scrunching up, as i want it to??

 

the html..

<code>

<div id="header">

  <div id="logo"><img src="images/studybot_logo.jpg" alt="Study Bot logo" width="171" height="30" /></div>

  <div id="logo2">Content for id "logo2" Goes </div>

</div></code>

 

the css..

 

<code>#header {

width: 100%;

background-color: #E8E8E8;

padding-left: 28px;

padding-top: 20px;

float: left;

margin-top: -20px;

margin-bottom: -20px;

margin-left: -20px;

height: 40px;

}

#logo {

float: left;

margin-bottom: 10px;

}

 

#logo2 {

height: auto;

width: auto;

float: left;

margin-top: 12px;

margin-left: 60px;

}

</code>

 

any ideas??

 

 

Link to comment
https://forums.phpfreaks.com/topic/44216-percentage-widths-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.