Results 1 to 4 of 4

Thread: Button Question Again?

  1. #1
    Join Date
    Dec 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Button Question Again?

    I downloaded the images for these grey buttons (http://www.dynamicdrive.com/style/cs...quare_buttons/)and I then assigned them to the right url (I think) and I copy and pasted the css and html codes to my source (I'm using visual web developer '05) and when I debugged it just came up clear....no color to the buttons just writing and a clear box no glossy grey buttons. Here are the codes I used:

    <style type="text/css">

    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */

    a.squarebutton{
    background: transparent url(C:\Users\Phillip\Documents\square-gray-left.gif) no-repeat top left;
    display: block;
    float: left;
    font: normal 12px Arial; /* Change 12px as desired */
    line-height: 15px; /* This value + 4px + 4px (top and bottom padding of SPAN) must equal height of button background (default is 23px) */
    height: 23px; /* Height of button background height */
    padding-left: 9px; /* Width of left menu image */
    text-decoration: none;
    }

    a:link.squarebutton, a:visited.squarebutton, a:active.squarebutton{
    color: #494949; /*button text color*/
    }

    a.squarebutton span{
    background: transparent url(C:\Users\Phillip\Documents\square-gray-right.gif) no-repeat top right;
    display: block;
    padding: 4px 9px 4px 0; /*Set 9px below to match value of 'padding-left' value above*/
    }

    a.squarebutton:hover{ /* Hover state CSS */
    background-position: bottom left;
    }

    a.squarebutton:hover span{ /* Hover state CSS */
    background-position: bottom right;
    color: black;
    }

    .buttonwrapper{ /* Container you can use to surround a CSS button to clear float */
    overflow: hidden; /*See: http://www.quirksmode.org/css/clearing.html */
    width: 100%;
    }

    </style><h4>Single button:</h4>

    <div class="buttonwrapper">
    <a class="squarebutton" href="http://www.dynamicdrive.com/style/"><span>Dynamic Drive CSS Library</span></a>
    </div>

    <h4>Side by Side:</h4>

    <div class="buttonwrapper">
    <a class="squarebutton" href="#"><span>Submit</span></a> <a class="squarebutton" href="#" style="margin-left: 6px"><span>Reset</span></a>
    </div>

  2. #2
    Join Date
    Dec 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry for accidentally making two posts btw

  3. #3
    Join Date
    Dec 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    "background: transparent url(C:\Users\Phillip\Documents\square-gray-left.gif) no-repeat top left;"

    change the path of the image relative to your web site as
    background: transparent url(images/square-gray-left.gif) no-repeat top left;

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Or better yet, upload the two square images to your web server first, then use absolute URLs when pointing to them in the CSS code:

    Code:
    background: transparent url(http://www.mysite.com/images/square-gray-left.gif) no-repeat top left;
    and so on. Obviously verify that http://www.mysite.com/images/square-gray-left.gif works first.

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
  •