Create a button with a double border? - css

The button I want:
I have tried this, but it doesn't work:
button {
font-family: 'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
border: 3px double #f26700;
background: #f26700;
}
How can i display this white line with CSS?

Write:
button{
border: 3px double white;
}
DEMO here.
OR:
button{
border: 1px double white;
outline: 1px solid #f26700;
}
DEMO here.
OR:
button{
border: 2px solid white;
box-shadow:0 0 0 0px white, 0 0 0 2px #F26700;
}
DEMO here.

as commented, 2 easy options :
box-shadow and outline:
button {
font-family: 'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
border: 1px solid white;
background: #f26700;
outline:solid #f26700 1px;
padding:0.25em 1em;
}
button + button {
box-shadow: 0 0 0 1px #f26700;
outline:none;
}
demo : http://codepen.io/anon/pen/InDqa
button {
font-family: 'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
border: 1px solid white;
background: #f26700;
outline: solid #f26700 1px;
padding: 0.25em 1em;
}
button+button {
box-shadow: 0 0 0 1px #f26700;
outline: none;
}
<button>outlined</button> <button>shadowed</button>

Use the outline property:
CSS
.button {
font-family:'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
line-height: 1.8em;
border: 1px solid white;
background: #f26700;
width: 100px;
height: 30px;
text-align: center;
outline: 1px solid #f26700;
}
Here's the JSFiddle: http://jsfiddle.net/2kgGF/

You can do this just with an outline.
button {
width: 8rem;
font-size: 1rem;
line-height: 2.4rem;
color: white;
background: darkorange;
border: none;
outline: .1rem solid white;
outline-offset: -.3rem;
}
http://jsfiddle.net/lrsbck/7Zp6X/

Related

How to make css not repeat same class?

.class-action:hover, .class-action.activeOne {
color: black;
font-weight: bold;
}
.class-action.activeOne {
margin: 3px 0px;
border-bottom: 2px solid black;
}
is there a way to stack these css code? I dont want to repeat same class again. I want all four style for ".class-action.activeOne" and only above 2 style when ".class-action:hover"
other option is below, but it repeats the css
.class-action:hover {
color: black;
font-weight: bold;
}
.class-action.activeOne {
color: black;
font-weight: bold;
margin: 3px 0px;
border-bottom: 2px solid black;
}
Simply nest your selectors:
.class-action {
&:hover,
&.activeOne {
color: black;
font-weight: bold;
}
&.activeOne {
margin: 3px 0px;
border-bottom: 2px solid black;
}
}

How can I make a button change its background color when pressed down?

I am using AngularJS and I wonder if there are any features that can help me. I have the following button CSS:
button {
background-color: #button-background-color;
border: 1px solid #button-border;
background-color: #ccc;
border: 1px solid #999;
color: #button-color;
background: #e6e6e6;
background-image: -moz-linear-gradient(top,#fff,#d9d9d9);
background-image: -webkit-linear-gradient(top,#fff,#d9d9d9);
background-image: -o-linear-gradient(top,#fff,#d9d9d9);
background-image: -ms-linear-gradient(top,#fff,#d9d9d9);
background-image: linear-gradient(top,#fff,#d9d9d9);
border: 1px solid #ccc;
border-top-color: #ccc;
border-bottom-color: #a2a2a2;
border-radius: 4px;
text-shadow: 0 1px 0 rgba(255,255,255,1);
box-shadow: 0 1px 1px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.2);
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
display: inline-block;
line-height: 18px;
line-height: 1.8rem;
font-size: 14px;
font-size: 1.4rem;
cursor: pointer;
color: #474747;
padding: 4px 10px 3px 10px;
font-family: arial,sans-serif;
vertical-align: middle;
}
This looks good but I would like to have an effect that appears when I hover over and click on a button without yet releasing the click.
Is there any way that I can catch this with angular and have the class changed for the period when I am holding down the button?
Please note that I am looking for a CSS only or a CSS/AngularJS solution. I am not using jQuery.
Thanks
http://www.w3schools.com/cssref/sel_hover.asp
http://www.w3schools.com/cssref/sel_active.asp
button:hover button:active
button {
background-color: #button-background-color;
border: 1px solid #button-border;
background-color: #ccc;
border: 1px solid #999;
color: #button-color;
background: #e6e6e6;
background-image: -moz-linear-gradient(top,#fff,#d9d9d9);
background-image: -webkit-linear-gradient(top,#fff,#d9d9d9);
background-image: -o-linear-gradient(top,#fff,#d9d9d9);
background-image: -ms-linear-gradient(top,#fff,#d9d9d9);
background-image: linear-gradient(top,#fff,#d9d9d9);
border: 1px solid #ccc;
border-top-color: #ccc;
border-bottom-color: #a2a2a2;
border-radius: 4px;
text-shadow: 0 1px 0 rgba(255,255,255,1);
box-shadow: 0 1px 1px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.2);
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
display: inline-block;
line-height: 18px;
line-height: 1.8rem;
font-size: 14px;
font-size: 1.4rem;
cursor: pointer;
color: #474747;
padding: 4px 10px 3px 10px;
font-family: arial,sans-serif;
vertical-align: middle;
}
button:hover
{
background: red;
}
button:active
{
background: green;
}
<button>button</button>
you can put the following css:
button:active{
background-color: red;
}
for more information: http://www.w3schools.com/cssref/sel_active.asp

How to Change Selected tab color using ajax in asp.net?

I used a Master Page and on separate page, I used ajax tab control but unable to change selected tab color..
Thanx in Advance
You can use this css.
.MyTabStyle .ajax__tab_header
{
font-family: "Helvetica Neue" , Arial, Sans-Serif;
font-size: 14px;
font-weight: bold;
display: block;
margin-left:20px;
z-index:-1000;
}
.MyTabStyle .ajax__tab_header .ajax__tab_outer
{
border-color: #222;
color: #222;
padding-left: 10px; /*margin-right: 3px;*/
border: solid 1px #999;
border-bottom-color: #d7d7d7;
-webkit-margin-before: 1em;
-webkit-margin-after: -1px;
-webkit-margin-start: 0px;
-webkit-margin-end: -1px;
}
.MyTabStyle .ajax__tab_header .ajax__tab_inner
{
border-color: #666;
color: #000;
padding: 0px 5px 0px 5px;
}
.MyTabStyle .ajax__tab_hover .ajax__tab_outer
{
border-color: #BBB; /*color #1*/
background: white;
color: Black;
}
.MyTabStyle .ajax__tab_hover .ajax__tab_inner
{
color: Black;
cursor: pointer;
}
.MyTabStyle .ajax__tab_outer
{
padding: 0 16px; /* edit 16px for different tab width */
display: inline-block;
font: normal 12px Verdana;
line-height: 25px; /* height #1 */
text-decoration: none;
color: #333;
border: 1px solid #999; /*This color can be different from color #2 */
border-bottom: none;
background: #F6F6F9;
outline: none;
border-radius: 5px 5px 0 0;
position: relative;
margin: 0 -1px -1px 0;
text-align: -webkit-match-parent;
}
.MyTabStyle .ajax__tab_active .ajax__tab_outer
{
color: white;
font-weight: bold;
border-color: #BBB; /*color #1*/
background: #0099CC; /*color #2*/
/*z-index: 3;*/
padding: 1px 10px 0px 10px;
border-bottom-width: 0px;
}
.MyTabStyle .ajax__tab_active .ajax__tab_inner
{
color: white;
border-color: #333;
padding: 0px 10px 0px 10px;
}
.MyTabStyle .ajax__tab_body
{
font-family: verdana,tahoma,helvetica;
font-size: 10pt;
/*background-color: #fff;*/ /*border-top-width: 0;*/
border: solid 1px #d7d7d7; /*border-top-color: #ffffff;*/
padding: 10px 10px;
border-radius: 4px;
box-shadow: 0 0 8px #CCC;
background-color: white;
}
HTML
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Width="100%"
CssClass="MyTabStyle" OnClientActiveTabChanged="SaveActiveTabIndex">
<asp:TabPanel HeaderText="Personal Details" runat="server" ID="TabPanel1">
<ContentTemplate>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
I know it's an old question, but if anyone will need this, a working answer is:
.MyTabStyle .ajax__tab_tab /*inactive tab*/
{
outline: 0;
}
.MyTabStyle .ajax__tab_active .ajax__tab_tab /*active tab*/
{
color: #d13f31;
outline: 0;
}

css padding the placeholder text inside the text field

I am trying to pad the bottom area for the placeholder text, because it is too close to the line. but i am not sure what property is going to work. Here is my css. And also, another problem is that when I open it on firefox, the magnifying icon is about 1 pixel higher than the line. It looks fine on chrome. Does anybody know?
Thanks.
.search_input{
font-family: Helvetica;
font-size:14px;
border:1px solid #000000;
border-top:1px;
border-right: -0px;
border-left: 0px;
margin-left: 3px;
margin-right: -23px;
margin-top: 6px;
width: 150px;
box-sizing: border-box;
}
#tfnewsearch input:focus {
outline: 0;
background: #fff;
-moz-box-shadow: 0 0 2px rgba(0,0,0,.8) inset;
-webkit-box-shadow: 0 0 2px rgba(0,0,0,.8) inset;
box-shadow: 0 0 2px rgba(0,0,0,.8) inset;
}
#tfnewsearch input::-webkit-input-placeholder {
color: #999;
font-size: 17px;
padding-bottom:3px;
height: 19px;
}
#tfnewsearch input:-moz-placeholder {
color: #999;
font-size: 17px;
padding-bottom:3px;
}
#tfnewsearch input:-ms-input-placeholder {
color: #999;
font-size: 17px;
padding-bottom:3px;
}
.t_button {
outline: none; cursor: pointer;margin-bottom: -5px; margin-left: 22px;margin-right: 1px; border: solid 1px #000000; border-top:0px; border-left: 1px; border-right: 1px;
}
<form id="tfnewsearch" method="get" action="index.php">
<input type="text" class="search_input" name="q" size="17" maxlength="120" placeholder="Search" required><img src="imgs/icon_search.gif" value="search" class="t_button">
</form>
try to use padding to .search_input
.search_input{
font-family: Helvetica;
font-size:14px;
border:1px solid #000000;
border-top:1px;
border-right: -0px;
border-left: 0px;
margin-left: 3px;
margin-right: -23px;
margin-top: 6px;
width: 150px;
box-sizing: border-box;
padding-bottom:5px;
}
http://jsfiddle.net/yZXSJ/

CSS div border changes to black when visited

I have a menu where each link is a div box. This div box have a gray border-bottom, however, when the link is visited it turns black. I just can't figure why.
On the following image I've clicked the Rediger profil and Log af links.
JSFiddle: http://jsfiddle.net/LpGbT/
HTML
<div id="design_sidebar">
<div id="design_sidebar_head">
Patrick Reck
</div>
<div class="design_sidebar_menu_item">Besøgende</div>
<div class="design_sidebar_menu_item">Mine favoritter</div>
<div class="design_sidebar_menu_item">Rediger profil</div>
<div class="design_sidebar_menu_item">Log af</div>
</div>
CSS
a {
text-decoration: none;
}
#design_sidebar {
width: 200px;
float: left;
border: 1px solid #d6d6d6;
-moz-border-radius: 2px;
border-radius: 2px;
background-color: white;
}
#design_sidebar_head {
width: 165px;
height: 30px;
font-family: Segoe;
font-size: 14px;
font-weight: bold;
color: #333333;
padding-top: 10px;
padding-left: 35px;
border-bottom: 1px solid #d6d6d6;
background-image: url('../img/icons/user.png');
background-repeat: no-repeat;
background-position: 10px 11px;
background-color: #f7f7f7;
}
.design_sidebar_menu_item {
padding: 5px;
padding-left: 10px;
font-size: 14px;
color: #333333;
border-bottom: 1px solid #d6d6d6;
}
.design_sidebar_menu_item:hover {
color: white;
background-color: #a6242f;
}
You may define a copied version of your div selector with a :visited suffix in order to set new colours for visited objects.
Aldo div classes are prefixed with a dot (.) instead of a sharp (#) character. Just a reminder. :)
.design_sidebar_menu_item:visited {
border-color: <your_color>;
}
If it doesn't harm your design etc. I would suggest this:
HTML:
<div id="design_sidebar">
<div id="design_sidebar_head">
Patrick Reck
</div>
Patrick Reck
Besøgende
Mine favoritter
Rediger profil
Log af
</div>
CSS:
div#design_sidebar a {
text-decoration: none;
padding: 5px;
padding-left: 10px;
font-size: 14px;
color: #333333;
border-bottom: 1px solid #d6d6d6;
display: block;
}
div#design_sidebar a:hover {
color: white;
background-color: #a6242f;
}
#design_sidebar {
width: 200px;
float: left;
border: 1px solid #d6d6d6;
-moz-border-radius: 2px;
border-radius: 2px;
background-color: white;
}
#design_sidebar_head {
width: 165px;
height: 30px;
font-family: Segoe;
font-size: 14px;
font-weight: bold;
color: #333333;
padding-top: 10px;
padding-left: 35px;
border-bottom: 1px solid #d6d6d6;
background-image: url('../img/icons/user.png');
background-repeat: no-repeat;
background-position: 10px 11px;
background-color: #f7f7f7;
}
EDIT:
How about adding:
a {
text-decoration: none;
display: block;
border-bottom: 1px solid #d6d6d6;
}
And removing border-bottom: 1px solid #d6d6d6; from .design_sidebar_menu_item {...}
The others will need links around them for this to work.
It doesn't..
I changed border-bottom color to 'green'. Now you have a clear view.
Check jsFiddle : check it out
.design_sidebar_menu_item {
padding: 5px;
padding-left: 10px;
font-size: 14px;
color: #333333;
border-bottom: 1px solid #00FF00;
}

Resources