Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    CSS #newBox question

    Hello

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

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

    Code:
    <div id="newBox"><img src="./images/main.gif" width="500" height="254"></div>
    rates.asp, however, uses:

    Code:
    <img src="./images/comic.gif" width="482" height="314">
    work.asp, uses the same idea:

    Code:
    <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:

    Code:
    #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:

    Code:
    #newBox1 
    
    {
    width:160px
    height: 254px;
    margin: 0 0 0 0;
    /*float:left*/
    }
    Thanks.

    Steve

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    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:

    Code:
    <div id="newBox"><img src="./images/main.gif" width="500" height="254"></div>
    So, all I would need to do is:

    For page 1:
    Code:
    <div id="newBox"><img src="./images/image1.gif" width="500" height="254"></div>
    For page 2:
    Code:
    <div id="newBox"><img src="./images/image2.gif" width="500" height="254"></div>
    For page 3:
    Code:
    <div id="newBox"><img src="./images/image3.gif" width="500" height="254"></div>
    And I leave the CSS untouched?

    Thanks.

    Steve


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •