I created two buttons. My intention is to set them in exact same line as buttons at the left side. As U can see at my attachement, delete button is scrolled up one line. Any ideas how to achieve my intention?
Here are CSS rlues for yellow button:
.button-own_I {
float:right;
display: inline-block;
text-align: center;
vertical-align: middle;
padding: 7px 6px;
border: 1px solid #a12727;
border-radius: 8px;
background: #ffff4a;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff4a), to(#998f26));
background: -moz-linear-gradient(top, #ffff4a, #998f26);
background: linear-gradient(to bottom, #ffff4a, #998f26);
text-shadow: #591717 1px 1px 1px;
font: normal normal bold 11px arial;
color: #ffffff;
text-decoration: none;
margin:5px;
}
.button-own_I:hover,
.button-own_I:focus {
background: #ffff59;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff59), to(#b8ac2e));
background: -moz-linear-gradient(top, #ffff59, #b8ac2e);
background: linear-gradient(to bottom, #ffff59, #b8ac2e);
color: #ffffff;
text-decoration: none;
}
.button-own_I:active {
background: #99992c;
background: -webkit-gradient(linear, left top, left bottom, from(#99992c), to(#998f26));
background: -moz-linear-gradient(top, #99992c, #998f26);
background: linear-gradient(to bottom, #99992c, #998f26);
}
Here are CSS rules for red button:
.buttonDelete {
float:right;
display: inline-block;
text-align: center;
vertical-align: middle;
padding: 8px 12px;
border: 1px solid #a12727;
border-radius: 8px;
background: #ff4a4a;
background: -webkit-gradient(linear, left top, left bottom, from(#ff4a4a), to(#992727));
background: -moz-linear-gradient(top, #ff4a4a, #992727);
background: linear-gradient(to bottom, #ff4a4a, #992727);
text-shadow: #591717 1px 1px 1px;
font: normal normal bold 11px arial;
color: #ffffff;
text-decoration: none;
}
.buttonDelete:hover,
.buttonDelete:focus {
background: #ff5959;
background: -webkit-gradient(linear, left top, left bottom, from(#ff5959), to(#b62f2f));
background: -moz-linear-gradient(top, #ff5959, #b62f2f);
background: linear-gradient(to bottom, #ff5959, #b62f2f);
color: #ffffff;
text-decoration: none;
}
.buttonDelete:active {
background: #982727;
background: -webkit-gradient(linear, left top, left bottom, from(#982727), to(#982727));
background: -moz-linear-gradient(top, #982727, #982727);
background: linear-gradient(to bottom, #982727, #982727);
}
ABCDEFGHIJKLMONOPQRSTUVWXYZ
The yellow button has a margin at the end, the other don't. If you remove the margin from the yellow, or add margin to the red one your problem will be solved
Here's a pen showing it working:
https://codepen.io/anon/pen/xWWZdo
.button-own_I {
float: right;
display: inline-block;
text-align: center;
vertical-align: middle;
padding: 7px 6px;
border: 1px solid #a12727;
border-radius: 8px;
background: #ffff4a;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff4a), to(#998f26));
background: -moz-linear-gradient(top, #ffff4a, #998f26);
background: linear-gradient(to bottom, #ffff4a, #998f26);
text-shadow: #591717 1px 1px 1px;
font: normal normal bold 11px arial;
color: #ffffff;
/* --- HERE -- */
text-decoration: none;
margin:5px;
}
.buttonDelete {
float:right;
display: inline-block;
text-align: center;
vertical-align: middle;
padding: 8px 12px;
border: 1px solid #a12727;
border-radius: 8px;
background: #ff4a4a;
background: -webkit-gradient(linear, left top, left bottom, from(#ff4a4a), to(#992727));
background: -moz-linear-gradient(top, #ff4a4a, #992727);
background: linear-gradient(to bottom, #ff4a4a, #992727);
text-shadow: #591717 1px 1px 1px;
font: normal normal bold 11px arial;
color: #ffffff;
/* --- AND HERE -- */
text-decoration: none;
margin:5px;
}
Related
I have a semi-round button. But I don't know how to bend it for my semi-round button in it's border.
.semi-circle {
display: inline-block;
padding: 9px 16px;
border-radius: 999px !important;
text-align: center;
/*border: 10px solid transparent;*/
/* -moz-border-image: -moz-linear-gradient(right, #FC913A 0%, #FF4E50 100%);
-webkit-border-image: -webkit-linear-gradient(right, #FC913A 0%, #FF4E50 100%);
border-image: linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
/*border-image-slice: 1;*/
border: linear-gradient(to right, green 0%, blue 100%);
/*background-image: linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -o-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -moz-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -webkit-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -ms-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
*/
}
Forgive me for not being able to embed the image because of lack of reputation. Thx for the stack overflow community for its great service.
Here is solution. It works fine in webkit. In other browsers text color is solid.
HTML
<button data-text="Round button"></button>
<button class="active" data-text="Active round button"></button>
CSS
body {
background: #384041;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
button {
display: inline-block;
border: none;
outline: none;
appearance: none;
background: red;
position: relative;
z-index: 3;
height: 60px;
border-radius: 30px;
padding: 0 21px;
font-size: 21px;
box-shadow: -1px -1px 1px 0 black;
background: #4f4f4f;
}
button:before {
content: attr(data-text);
min-width: 144px;
z-index: -1;
border-radius: 27px;
color: #4f4f4f;
}
#media screen and (-webkit-min-device-pixel-ratio:0) { button:before {
background: #4f4f4f;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}}
button:after {
content: '';
position: absolute;
left: 3px;
right: 3px;
top: 3px;
bottom: 3px;
z-index: -2;
border-radius: 30px;
background: #151515;
}
button:hover {
cursor: pointer;
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
}
.active {
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
}
.active:before{
color: #2084c3;
}
#media screen and (-webkit-min-device-pixel-ratio:0) { .active:before {
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}}
Demo
There are probably better ways to do this, but without further thinking I'd try something like this:
<style type="text/css">
.semi_outer {
padding: 2px;
text-align: center;
border-radius: 11px;
background: linear-gradient(to right, #0f0, #00f);
}
.semi_inner {
margin: 2px;
border-radius: 7px;
background-color: #000;
color: #0f0;
}
.semi_outer:hover {
background: linear-gradient(to right, #c00, #0c0);
}
.semi_outer:active {
background: linear-gradient(to right, #f00, #0f0);
}
</style>
<div class="semi_outer">
<div class="semi_inner">
semi_inner
</div>
</div>
This is your semi-round button . may be it will be helpfull for you.
.outer {
padding: 2px;
text-align: center;
border-radius: 11px;
background: linear-gradient(to right, #0f0, #00f);
width: 200px;
height:30px;
}
.inner {
margin: 3px;
border-radius: 7px;
background-color: #000;
color: #0f0;
height:25px;
}
.outer:hover {
background: linear-gradient(to right, #c00, #0c0);
}
.outer:active {
background: linear-gradient(to right, #f00, #0f0);
}
<div class="outer">
<div class="inner">
BUTTON
</div>
</div>
I am using Jquery UI, and I need the jquery-ui.css for datepicker and buttonset. However, I am also using jquery tabs in the site.
I have added custom styling to the tabs in my own css folder (not jquery-ui.css), but when I add the jquery-ui.css it adds lots of other styling to my tabs, which look really bad.
I was wondering is there a way to remove the tabs styling from jquery-ui.css?
If it helps this is the html and styling for my tabs:
<ul id="product_tabs_list"><li>Description</li><li>Features</li><li>Specifications</li><li>Technical</li><div class="clr"></div></ul>
#product_tabs_list{
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin-bottom: 10px;
padding: 11px 5px;
text-align: center;
}
#product_tabs_list li {
float: left;
}
#product_tabs_list li a {
background: #fff;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#fff), to(#eaeaea)) no-repeat;
background: -webkit-linear-gradient(#fff, #eaeaea) no-repeat;
background: -moz-linear-gradient(#fff, #eaeaea) no-repeat;
background: -ms-linear-gradient(#fff, #eaeaea) no-repeat;
background: -o-linear-gradient(#fff, #eaeaea) no-repeat;
background: linear-gradient(#fff, #eaeaea) no-repeat;
border: 1px solid #cfcfcf;
color: #3463a0;
font-weight: bold;
padding: 10px 20px;
-webkit-text-shadow: 1px 1px 1px #fff;
-moz-text-shadow: 1px 1px 1px #fff;
text-shadow: 0px 1px 1px #fff;
}
#product_tabs_list li a:hover {
background: #fff;
}
#product_tabs_list li.ui-tabs-active a {
background: #3463a0;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#3463a0), to(#233f64)) no-repeat;
background: -webkit-linear-gradient(#3463a0, #233f64) no-repeat;
background: -moz-linear-gradient(#3463a0, #233f64) no-repeat;
background: -ms-linear-gradient(#3463a0, #233f64) no-repeat;
background: -o-linear-gradient(#3463a0, #233f64) no-repeat;
background: linear-gradient(#3463a0, #233f64) no-repeat;
color: #fff;
-webkit-text-shadow: 1px 1px 1px #00204b;
-moz-text-shadow: 1px 1px 1px #00204b;
text-shadow: 0px 1px 1px #00204b;
}
I don't know if I'll successfully convey what I mean but here goes. I have some CSS and am trying to get the text label of a link in a navigation to button to show if I hover anywhere over that button, not just over where the link should display. What happens is when I hover over most of the button, the button goes all-white. I want it to be white background, but show the text. Make sense?
Just try something as below:
CSS:
.CSSButton {
border: 1px solid #D1D1D1;
background: -webkit-gradient( linear, left top, left bottom, color-stop(0.1, #FFFFFF), color-stop(0.9, #D1D1D1) );
background: -moz-linear-gradient( center top, #FFFFFF 10%, #D1D1D1 90% );
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#D1D1D1');
background-color: #FFFFFF;
-moz-box-shadow: inset 0px 1px 2px 0px #FFFFFF;
-webkit-box-shadow: inset 0px 1px 2px 0px #FFFFFF;
box-shadow: inset 0px 1px 2px 0px #FFFFFF;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
text-shadow: 1px 1px 2px #FFFFFF;
font-weight: bold;
margin: 5px 5px;
padding: 6px 6px;
color: #999999;
letter-spacing: 1px;
font-family: 'Arial', sans-serif;
font-size: 16px;
width: 150px;
text-transform: capitalize;
text-align: center;
text-decoration: none;
cursor: pointer;
display: inline-block;
}
.CSSButton:hover {
background: -webkit-gradient( linear, left top, left bottom, color-stop(0.1, #D1D1D1), color-stop(0.9, #FFFFFF) );
background: -moz-linear-gradient( center top, #D1D1D1 10%, #FFFFFF 90% );
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1D1D1', endColorstr='#FFFFFF');
background-color: #D1D1D1;
}
.CSSButton:active {
position: relative;
top: 1px;
left: 0px;
}
HTML:
<span class="CSSButton">Click Me!</span>
I currently have a link and I'm using it as a button look to it and I would like to add an icon to it.
Example: a plus sign + icon next to a word that will say Add User. Here is my link:
<a class="glossyBtn" href='<%:Url.Action("Edit", "Case", new{caseId = Model}) %>'>Cancel</a>
Here is my .glossyBtn style:
.glossyBtn
{
display: inline-block;
background-color: #c1e2f4;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #b1daf1);
background-image: -moz-linear-gradient(top, #eeeeee, #b1daf1);
background-image: -ms-linear-gradient(top, #eeeeee, #b1daf1);
background-image: -o-linear-gradient(top, #eeeeee, #b1daf1);
background-image: linear-gradient(top, #eeeeee, #b1daf1);
border: 1px solid #3e95c8;
border-bottom: 1px solid #3e95c8 !Important;
border-radius: 3px;
color: #046fad !Important;
font: bold 12px Helvetica Neue, Helvetica, Arial, sans-serif;
padding: 5px 12px;
text-align: center;
text-shadow: 0 1px 0 #eee;
text-decoration: none;
cursor: pointer;
list-style: none;
float: left;
margin-top: 5px;
margin-right: 5px;
}
Live demo: Tinkerbin
I haven't tested this, but the following should work with proper positioning:
<a class="glossyBtn" href='<%:Url.Action("Edit", "Case", new{caseId = Model}) %>'><span><img src="plus.png" alt=""></span>Cancel</a>
By prefixing the text with a <span> containing an <img>, you can insure the image stays inline with the text on the right.
Use the :after pseudo-selector:
.glossyBtn:after {
content: '+';
padding-left: 5px;
}
Live demo: Tinkerbin
If you want to add the plus character before the text, use :before pseudo-selector:
.glossyBtn:before {
content: '+';
padding-right: 5px;
}
Live demo: Tinkerbin
I've added padding left/right, to make some space between the text and the plus character.
I have problem with CSS <buttons> in Google Chrome, it shows space between <buttons>, but in Opera and IE it is OK, why?
Here is the full CSS code:
button {
border: 1px solid #bdbdbd;
text-shadow: 0 1px 1px white;
font: bold 11px Sans-Serif;
padding: 6px 8px;
white-space: nowrap;
vertical-align: middle;
color: #666;
background: -webkit-linear-gradient(top, white, #E0E0E0);
background: -moz-linear-gradient(top, white, #E0E0E0);
background: -ms-linear-gradient(top, white, #E0E0E0);
background: -o-linear-gradient(top, white, #E0E0E0);
cursor: pointer;
text-decoration: none;
margin-right: -1px;
}
Here is HTML code:
<div><button type="button">Send</button><button type="button">Reset</button></div>
Thanks for help.
Each set of buttons is contained within a div which has a margin-left of three (3) pixels.
EDIT Chrome also applies a default margin of one (1) pixel. You need to set the margin to zero (0) for the buttons to get rid of this spacing.
Seems to be a left margin as well. This corrects it in Chrome (not sure what it'll do in other browsers)... I edited the margin property.
button {
border: 1px solid #bdbdbd;
text-shadow: 0 1px 1px white;
font: bold 11px Sans-Serif;
padding: 6px 8px;
white-space: nowrap;
vertical-align: middle;
color: #666;
background: -webkit-linear-gradient(top, white, #E0E0E0);
background: -moz-linear-gradient(top, white, #E0E0E0);
background: -ms-linear-gradient(top, white, #E0E0E0);
background: -o-linear-gradient(top, white, #E0E0E0);
cursor: pointer;
text-decoration: none;
margin: 0 -1px 0 0;
}