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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Button graphic on photoshop, How do I apply it to my HTML?

    Hello everyone,

    I'm still trying to figure out what the best way is of applying something you designed on photoshop like a button in my case to your website.

    I am trying to modify the background of my current button by pointing to my the photoshop graphic but it does not change.

    This is my current code:

    Button: <a href="index.html" class="button"> Home</a>
    Button Class:
    button {
    background-color:#000000;
    border-right: 1px solid #FFFFFF;
    color:#FFCC00;
    font-size:0.8em;
    font-weight:bold;
    line-height:2;
    padding:5px 20px;
    text-decoration:none;
    }

    Currently my buttons are still without the background attribute as the code above reveals. Can someone please shed some light.

    Thank you,

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Button: <a href="index.html" class="button"> Home</a>
    Button Class:
    button {
    background-color:#000000;
    border-right: 1px solid #FFFFFF;
    color:#FFCC00;
    font-size:0.8em;
    font-weight:bold;
    line-height:2;
    padding:5px 20px;
    text-decoration:none;
    }
    The class selector for button is .button
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    The class selector for button is .button
    Yes I do have a point in my code. It's just I missed it while copying the code over here.
    Thanks

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I get small a rectangular box having a black background by that code.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello lallous,
    What is the path to your button graphic? I don't see that you're loading it at all.
    Code:
    .button {
    background:#000 url(path/to/your.img);
    border-right: 1px solid #FFFFFF;
    color:#FFCC00;
    font-size:0.8em;
    font-weight:bold;
    line-height:2;
    padding:5px 20px;
    text-decoration:none;
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    i think you're asking for the code to use an image instead of a colour..


    Code:
    .button {
    border-right: 1px solid #FFFFFF;
    
    background:url(path/to/my/image.jpg no-repeat; /* */
    
    /* i'd set height+width personally unless it repeats */
    
    color:#FFCC00;
    font-size:0.8em;
    font-weight:bold;
    line-height:2;
    padding:5px 20px;
    text-decoration:none;
    }

  • #7
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I managed to solve it.
    Thank you for your input everyone.


  •  

    Posting Permissions

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