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 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    how can i assign this code to more than one image

    i have this code which is a roll over code for an image but i have 4 differnt images so need the code for all four is there anyway i can aply it to all of them bye assigning a dif id just so the code isnt copyed over and over

    #cssnav
    {
    position: relative;
    font-family: arial, helvetica, sans-serif;
    background-image:url(webroll.png);
    white-space: nowrap;
    display: block;
    width: 211px;
    height: 94px;
    margin: 0;
    padding: 0;
    background-repeat: no-repeat;
    }

    #cssnav a
    {
    display: block;
    color: #000000;
    font-size: 11px;
    width: 211px;
    height: 134px;
    display: block;
    float: left;
    color: black;
    text-decoration: none;
    }

    #cssnav img
    {
    width: 190px;
    height: 120px;
    border: 0
    }

    #html a:hover
    {
    visibility:visible
    }

    #cssnav a:hover img
    {
    visibility:hidden
    }

    #cssnav span
    {
    position: absolute;
    left: 35px;
    top: 15px;
    margin: 0px;
    padding: 0px;
    cursor: pointer;
    width: 124px;
    }

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Yes. You could use a class instead of an ID. You can define a class like an ID just use instaed of #, a dot.
    Code:
    .This_is_a_class
    {
    }
    #This_is_an_ID
    {
    }
    And then add to all the images you'd like to use these properties:
    Code:
    <img class="This_is_a_class" />


  •  

    Posting Permissions

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