Solved

how to correct css3 button issue

Posted on 2014-02-11
2
253 Views
Last Modified: 2014-02-11
I have created css3 button like below:
Html:
<section id="startbutton"><a href="#startbutton" id="starticon">&#xF04b;</a></section>

Open in new window

css:
a {
font-family: "FontAwesome";
text-shadow: 0px 1px 1px rgba(250,250,250,0.1);
font-size: 32pt;
display: block;
position: relative;
text-decoration: none;
box-shadow: 0px 3px 0px 0px rgb(34,34,34),
0px 7px 10px 0px rgb(17,17,17),
inset 0px 1px 1px 0px rgba(250, 250, 250, .2), 
inset 0px -12px 35px 0px rgba(0, 0, 0, .5);
width: 70px;
height: 70px;
border: 0;
color: rgb(37,37,37);
border-radius: 35px;
text-align: center;
line-height: 79px;
background-color: rgb(83,87,93);

transition: color 350ms ease, text-shadow 350ms;
-o-transition: color 350ms ease, text-shadow 350ms;
-moz-transition: color 350ms ease, text-shadow 350ms;
-webkit-transition: color 350ms ease, text-shadow 350ms;
}
a:before {
content: "";
width: 80px;
height: 80px;
display: block;
z-index: -2;
position: absolute;
background-color: rgb(26,27,29);
left: -5px;
top: -2px;
border-radius: 40px;
box-shadow: 0px 1px 0px 0px rgba(250,250,250,0.1), 
 inset 0px 1px 2px rgba(0, 0, 0, 0.5);
}
a.on {
box-shadow: 0px 0px 0px 0px rgb(34,34,34),
0px 3px 7px 0px rgb(17,17,17), 
inset 0px 1px 1px 0px rgba(250, 250, 250, .2), 
inset 0px -10px 35px 5px rgba(0, 0, 0, .5);
background-color: rgb(83,87,93);
top: 3px;
color: #fff;
text-shadow: 0px 0px 3px rgb(250,250,250);
}

Open in new window

Above code creates css3 button. Please refer screenshot right side button.
But I don't want to use '<a>' element. So I have changed this to '<em>' and respective coding as below:
Html:
<section id="startbutton1"><em id="starticon1">&#xF04b;</em></section>

Open in new window

css:
em {
font-family: "FontAwesome";
text-shadow: 0px 1px 1px rgba(250,250,250,0.1);
font-size: 32pt;
display: block;
position: relative;
text-decoration: none;
box-shadow: 0px 3px 0px 0px rgb(34,34,34),
0px 7px 10px 0px rgb(17,17,17),
inset 0px 1px 1px 0px rgba(250, 250, 250, .2), 
inset 0px -12px 35px 0px rgba(0, 0, 0, .5);
width: 70px;
height: 70px;
border: 0;
color: rgb(37,37,37);
border-radius: 35px;
text-align: center;
line-height: 79px;
background-color: rgb(83,87,93);

transition: color 350ms ease, text-shadow 350ms;
-o-transition: color 350ms ease, text-shadow 350ms;
-moz-transition: color 350ms ease, text-shadow 350ms;
-webkit-transition: color 350ms ease, text-shadow 350ms;
}
em:before {
content: "";
width: 80px;
height: 80px;
display: block;
z-index: -2;
position: absolute;
background-color: rgb(26,27,29);
left: -5px;
top: -2px;
border-radius: 40px;
box-shadow: 0px 1px 0px 0px rgba(250,250,250,0.1), 
 inset 0px 1px 2px rgba(0, 0, 0, 0.5);
}
em.on {
box-shadow: 0px 0px 0px 0px rgb(34,34,34),
0px 3px 7px 0px rgb(17,17,17), 
inset 0px 1px 1px 0px rgba(250, 250, 250, .2), 
inset 0px -10px 35px 5px rgba(0, 0, 0, .5);
background-color: rgb(83,87,93);
top: 3px;
color: #fff;
text-shadow: 0px 0px 3px rgb(250,250,250);
}

Open in new window

Above code has some issue. Please refer screenshot left side button. How to solve this issue. Please advice.
screenshot.png
0
Comment
Question by:JohnLourdu
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 39849907
The <em> tag displays italicized by default. You can take that off by putting this in the em's CSS:
font-style: normal;

Open in new window

and the arrow character should display straight up again.
0
 

Author Closing Comment

by:JohnLourdu
ID: 39849927
Thanks a lot. It works.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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)

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now