...

View Full Version : CSS #newBox question



SteveH
06-16-2010, 03:04 PM
Hello

I have 3 files: index.asp, rates.asp, and work.asp

index.asp uses the following CSS to position an image:


<div id="newBox"><img src="./images/main.gif" width="500" height="254"></div>

rates.asp, however, uses:


<img src="./images/comic.gif" width="482" height="314">

work.asp, uses the same idea:


<img src="./images/main1.gif" width="500" height="254">

In my CSS file I have the following which relates to the image in index.asp as above:


#newBox

{
width:160px
height: 254px;
margin: 0 0 0 0;
/*float:left*/
}


Would it be best to follow this pattern for the other images instead of using what I have now, namely: <img src="./images/main1.gif"?????

If so, would I insert something like the following into my CSS file:


#newBox1

{
width:160px
height: 254px;
margin: 0 0 0 0;
/*float:left*/
}


Thanks.

Steve

_Aerospace_Eng_
06-16-2010, 04:40 PM
Yes do that only if you plan on the css to be different for each div around the image. If it will be the same then just use the same ID or a class however right now there is no need for the div at all. The div was there to float the image to the left but you aren't doing that anymore so no need for you. You can just give an ID to each image and style them that way but if its just width and height and there is no need for that either.

SteveH
06-17-2010, 09:38 AM
Hello _Aerospace_Eng

Thanks for your reply.

The image on each page is different, but the layout around those different images is that same as the first page:


<div id="newBox"><img src="./images/main.gif" width="500" height="254"></div>

So, all I would need to do is:

For page 1:

<div id="newBox"><img src="./images/image1.gif" width="500" height="254"></div>

For page 2:

<div id="newBox"><img src="./images/image2.gif" width="500" height="254"></div>

For page 3:

<div id="newBox"><img src="./images/image3.gif" width="500" height="254"></div>

And I leave the CSS untouched?

Thanks.

Steve



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum