Solved

image inside css button

Posted on 2013-10-24
1
359 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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. …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

752 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