Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: CSS image?

  1. #1
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation CSS image?

    HI all

    i did this with frontpage DHTML but it's gave me 2 styles and I need 3 so how can i make a CCS button thats have 3 styles 1- the normal image 2- the mouse over image 3- the on click image.

    and how can i add it to the HTML in frontpage " im not an expert"


    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    CSS can't create image. To create CSS effects during hover. You could have something like:
    Code:
    <html>
    <head>
    <title>My Title Here</title>
    <style type="text/css">
    #myid:hover{background:url('myimage.jpg'); color:#000;}
    </style>
    </head>
    <body>
    <div id="myid">
    Contents Here
    </div>
    </body>
    </html>
    In frontpage, I suppose there are 3 views. The design,normal and HTML. You could add your codes on the HTML view.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    no i didn't mean the CCS will create the image

    here is more details

    i have 3 images

    1- the normal image

    2- the mouse over image " will change when you mouse over the normal image"

    3 on click image " when you click on the normal image"

    so it's just change the images not the colors

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    See if this code fit your requirements :
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <style type="text/css">
    a:link{background:url('normal.jpg'); text-decoration:none;}
    a:hover{background:url('hover.jpg'); text-decoration:underline;}
    a:active{background:url('active.jpg'); color:#0000ff;}
    </style>
    </head>
    <body>
    <a href="#">
    Contents Here
    </a>
    </body>
    </html>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i tried to also change the code but didn't work

    any other way or how can i learn css easily

    thanks

  6. #6
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Here, try this.

    CSS
    Code:
    .image
    a:link,
    a:visited {
    width: width_of_image;
    height: height_of_image;
    cursor: default;
    display: block;
    background: url(NORMAL_IMAGE);
    }
    
    .image
    a:hover {
    background: url(ON_HOVER_IMAGE);
    }
    
    .image
    a:active {
    background: url(ON_CLICK_IMAGE);
    }
    HTML
    Code:
    <div class="image">
    <a href="#">&bnsp;</a>
    </div>
    If you were going to link it anyways, then just change the above one. It seems overly complicated to me, but it was the way I use for my sites nav so at least it works.

    Let me know how it goes,
    Tim

  7. #7
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    will i may still cant make it

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    What about the above 2 examples isn't working for you? They both work...
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have tried to do them but no use ( maybe because I didn't but them in the right way)

    so can you please make it Easier

    thanks

  10. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    I understand that, but what exactly isn't working? Do the images not show up? Some but not all? Explain what isn't working so that we can assist you.

    If I don't know whats wrong I can't fix it
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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