Themer Themer - 4 years ago 95
jQuery Question

DIV Position Fixed, inner content overlapping

I am creating a sticky header, the parent DIV is Fixed with set Height, I placed a logo within the div, and one DIV for menus. The logo does not fit within the parent container, its overlapping. How can I make it fit with Image Width:100%; so that it only first in parent height. Below is my

<div class="header">
<div class="logo">
<img src="">
<div class="menu">
Home . Services . About

Please have a look at this fiddle:

Answer Source

you never set the width or height of the <div class="logo">


.logo {


if you never set the width of the div the image is in, then in the css using

.logo img{

will take the max width and max height of the picture, and not go to the max available height. which should be the max height of the div the image is in. thus you will need to set the div's width and height

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download