Solved

image inside css button

Posted on 2013-10-24
1
358 Views
Last Modified: 2013-10-28
This question is a follow up to this question:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28276648.html

I want to place this image
http://farm8.staticflickr.com/7446/10466150066_1c6b3cac4d_o.png

Inside of my buttons to the left of the word "button"
I want the picture to be above the gradient background color.

This is my code:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CoolButton2.aspx.vb" Inherits="Gui1.CoolButton2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>CSS3 Buttons</title>
<%-------------- CSS Style --------------%>
<style type="text/css">


    
    body {
     width: 400px;
     margin: 200px auto;
     background: #666;
    }

    .button {
     width: 400px;
     height: 100px;
     line-height: 100px;
     color: white;
     text-decoration: none;
     font-size: 50px;
     font-family: helvetica, arial;
     font-weight: bold;
     display: block;
     text-align: center;
     position: relative;

     /* BACKGROUND GRADIENTS */
     background: #014464;
     background: -moz-linear-gradient(top, #0D658E, #0C577A 50%, #014D71 51%, #003E5C);
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0E658E), color-stop(.5, #0C577A), color-stop(.5, #014D71), to(#003E5C)); 


     /* BORDER RADIUS */
     -moz-border-radius: 10px;
     -webkit-border-radius: 10px;
     border-radius: 10px;

     border: 1px solid #368DBE;
     border-top: 1px solid #c3d6df;


     /* TEXT SHADOW */

     text-shadow: 1px 1px 1px black;

     /* BOX SHADOW */
     -moz-box-shadow: 0 1px 3px black;
     -webkit-box-shadow: 0 1px 3px black;
     box-shadow: 0 1px 3px black;
    }
    
    /* WHILE HOVERED */
    .button:hover {
        background: #014464;
        background: -moz-linear-gradient(top, #0c5f85, #0b5273 50%, #024869 51%, #003853);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0c5f85), color-stop(.5, #0b5273), color-stop(.51, #024869), to(#003853));
    }
    
    /* WHILE BEING CLICKED */
    .button:active {
        -moz-box-shadow: 0 2px 6px black;
        -webkit-box-shadow: 0 2px 6px black;
    }
    /* FONT GLYPH (MOSTLY FOR FUN) */
    .button:before {
        font-family: Arial;
        background: url('http://farm8.staticflickr.com/7446/10466150066_1c6b3cac4d_o.png') no-repeat;
        color: #09232F;
        font-size: 90px;
        float: left;
        margin-left: 35px;
        margin-right: -10px;
        text-shadow: 0 1px 0 #4190AF;
    }
    

</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <a href="#" class="button"> Button </a>
       <br /><br />
       <button class="button">Button</button>
        <br /><br />
        <asp:Button ID="Button1" runat="server" Text="Button" CssClass="button" />
        <br /><br />
        <input id="Button2" type="button" value="Button" class="button"/>
    </div>
    </form>
</body>
</html>

Open in new window


But it's not working.

What am I doing wrong?
0
Comment
Question by:maqskywalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39599166
Append you background CSS with a positioning. e.g.

background: url('http://farm8.staticflickr.com/7446/10466150066_1c6b3cac4d_o.png') no-repeat 5px 5px;

Just play around with the figures til it is where you want it, you can also use things like
left center
5px center
etc
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question