SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Aug 2002
    Location
    USA
    Posts
    544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    blue border around submit images?

    Is it possible to put a blue border around submit images (i.e. <input type="image" src="...">)? Maybe even make it highlight on mouseover? The idea is to make them similiar in appearance to IMG's enclosed in A tags.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The "true" solution:
    CSS:
    Code:
    input [type="image"] {
      border: 1px solid blue;
    }
    HTML:
    HTML Code:
    <input type="image" src="" />
    The solution that works in IE and other browsers:
    CSS:
    Code:
    input.image {
      border: 1px solid blue;
    }
    HTML:
    HTML Code:
    <input type="image" class="image" src="" />

  3. #3
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could do

    Code:
    input { border: 2px solid blue; }
    But IE won't understand a pure CSS way of doing it, like so:

    Code:
    input { border: 2px solid blue; }
    input:hover { border-color: red; }
    Something like this will help IE along:

    HTML Code:
    <input type="image" src="r.gif" 
      onmouseover="this.style.borderColor='red';" 
      onmouseout="this.style.borderColor='blue';" />
    hth,
    Douglas
    Hello World


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
  •