...

View Full Version : How to prevent image pushing down?



shakoor6
05-06-2011, 06:45 PM
I am inserting images and i want these images to be side by side...but one pushed the other down or vice versa. How can i prevent images being pushed down so I can position them beside each other?

DanInMa
05-06-2011, 07:21 PM
<img> elements are style Block by default. use css to give the images display:inline or you can float them depending on your needs.

shakoor6
05-06-2011, 07:45 PM
iv tried that still doesnt work..id appreciate if u can take a look at the coding for me thanx.

HTML

<div> <img class="nani" src="Homepage/Nani.jpg" width="85" height="54"/> </div>
<div> <img class="bpoints" src="Homepage/News.png" width="60" height="261"/> </div>

These are the two images.

CSS

img.nani{
padding-top: 0px;
padding-left: 14px;
display:inline
}

img.bpoints{
padding-top: 11px;
padding-left: 290px;
display: inline;
}

My CSS code for the two images.

AndrewGSW
05-06-2011, 09:04 PM
<img> elements are style Block by default. use css to give the images display:inline or you can float them depending on your needs.
I believe images are 'display:inline' by default.
But each image is contained within separate divs, which are 'display: block' by default:

<div> <img class="nani" src="Homepage/Nani.jpg" width="85" height="54"/> </div>
<div> <img class="bpoints" src="Homepage/News.png" width="60" height="261"/> </div>
Unless you have a specific reason not to do so, you could place the images within one div.

DanInMa
05-06-2011, 09:46 PM
ouch, your right. thanks for the correction! ( bad help is worse than no help)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum