Cannot apply CSS custom class in material design - css

<div class="col-md-offset-4 col-md-6">
<div style="margin-top: 50%">
<md-input-container class="col-md-10">
<label>
Username
</label>
<input type="text" ng-model="user.userName">
</md-input-container>
</div>
<br>
<div>
<md-input-container class="col-md-10">
<label>
Password
</label>
<input ng-model="user.userPassword">
</md-input-container>
</div>
<br>
<div class="col-md-10">
<a style="color: #2e98d6; border: 1px solid #2e98d6; text-transform: none; cursor: pointer;
min-height: 36px; min-width: 150px; font-weight: 500; font-size: 14px; border-radius: 37px;
padding: 0 20px;" class="md-button md-primary primary-btn pull-right" ng-click="doLogin()">Login</a>
</div>
</div>
I am trying to apply custom css class to my angular material but it is not working but if I using inline style then I can.

This works! So some of the styles were getting overridden by angular-material class, the simplest fix for this will be to add !important to the CSS properties that are getting overridden!
How to check what is getting overridden?
Open the console, select the element that you want to check, click the element and check for the CSS class you added, if any of the properties of that particular class have a strikethrough on them, then you add !important on that particular property!
Note: Since the stylesheets were not provided, I worked with the classes added by angular-material by default. Also Please ignore the Javascript part in the fiddle.
JSFiddle Demo
CSS:
.button-customize{
color: #2e98d6 !important;
border: 1px solid #2e98d6;
text-transform: none;
cursor: pointer;
min-height: 36px;
min-width: 150px;
font-weight: 500;
font-size: 14px;
border-radius: 37px !important;
padding: 0 20px;
}

Related

Styling Mail Chimp Form

I have an email opt in form for Mail Chimp at the top of my site and I cannot get the size of it to change. I want the subscribe button to be on the same line as the email field. Am I doing something wrong?
This is my form code:
<div id="mc_embed_signup">
<form action="//gleefulthings.us12.list-manage.com/subscribe/post?u=0277df98c0e296a094149262c&id=87ac16e6a6" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<div class="mc-field-group">
<input type="email" value="your email address" name="EMAIL" class="email" id="mce-EMAIL" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<input type="text" name="b_0277df98c0e296a094149262c_87ac16e6a6" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
And this is my CSS:
<!-- Defines how wide the opt-in will be and centers everything -->
#mc_embed_signup {
width: 880px;
margin: auto auto !important;
}
<!-- Moves the form to the left and sets the width -->
#mc_embed_signup input.email {
float: left !important;
width: 700px !important;
}
<!-- Defines the height of the div surrounding the form -->
#mc_embed_signup .mc-field-group {
min-height: 20px !important;
}
<!-- Moves the button to the right, removes the rounded corners, pushes the button up 45px -->
#mc_embed_signup input.button {
background: #bbcf14 !important;
color: #fff;
font-weight: 600;
display: inline-block !important;
border-radius: 0px !important;
float: right !important;
margin-top: -45px;
}
Here's a link to my test site: http://gleefulthings.com/WPtestblog/. Any help is much appreciated! I've been Googling and can't figure out why it's not working.
input[type="button"], input[type="reset"], input[type="submit"], .button
{
background-color: #111;
border: none;
color: #fff;
cursor: pointer;
font-size: 16px;
font-weight: 300;
padding: 16px 24px;
text-transform: uppercase;
width: 140px;
float: right;
height: 52px;
}
#mce-EMAIL
{
width: 89.9%;
float: left;
}
Dear Friend, I am edit your website online as my inspect element Chrome tool, it work fine.enter image description here This is screen shot of afterward applying CSS into your website.
Still you have any problem feel free to contact me.

Aligning icon class

As you can see by the image. The icon sits high. Any margin or padding I seem to try moves the text box down with it. With it positioned extra high, it also pushed the search text up. Any suggestions on how to fix?
I just want the search icon to be the same height and even with the search box and not mess with the label text.
.icon-btn {
padding: 0;
margin: 0;
display: inline-block;
height: 26px;
}
.icon-magnifier-dark:before {
background-color: white;
border: solid;
content: "\e035";
color: #color-light;
font-family: outlinedFont;
font-style: normal !important;
font-size: 20px;
line-height: 1;
box-sizing: border-box;
}
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<label for="Search" style="">Search</label>
<input type="text" name="Search" id="Search" size="10" style="" />
<a class="icon-btn" href="#" style="">
<i class="icon-magnifier-dark" style=""></i>
</a>
</div>
I think some other CSS might be overriding or changing the aligning, so you should check your full CSS once. I checked your JSFiddle which you provided in comment on one of the answer, I saw the aligning was OK in the Fiddle.
change font-size
font-family: outlinedFont;
font-style: normal !important;
font-size: 15px;
line-height: 1;
box-sizing: border-box;
}
You made it so difficult. Please Check this code below...
HTML:
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<label for="Search" style="">Search</label>
<input type="text" name="Search" id="Search" size="10" style="" />
<a class="icon-btn" href="#" style="">
<i class="icon-magnifier-dark" style=""></i>
</a>
</div>
Css:
.icon-btn {
display: inline-block;
width: 26px;
height: 26px;
background-color: red;
text-align: center;
padding:5px;
padding: 3px;
box-sizing: border-box;
}
.icon-magnifier-dark:before {
content: "\e035";
font-family: outlinedFont;
font-style: normal;
}
input[type="text"]{
width:150px;
height:26px;
vertical-align:top;
box-sizing: border-box;
margin-right: -5px;
}
Check the demo on jsfiddle

Bootstrap: Need help to center a button

Im trying to center this button but can't seem to get it to work, any help is much appreciated.
<div class="cta-btn">
<a class="btn btn-cta text-center" href="#" role="button">EXPLORE</a>
</div>
And the CSS
.btn-cta{
padding: 25px 80px;
border: 3px solid white;
background-color: transparent;
color: white;
font-family: Tahoma, Verdana, Segoe, sans-serif;
text-transform: uppercase;
font-size: 1.4em;
transition: all 0.3s ease;
}
Put the .text-center class on the enclosing div
<div class="cta-btn text-center">
<a class="btn btn-cta" href="#" role="button">EXPLORE</a>
</div>
Also, if you want the button to fill the width of the div, add the .btn-block class to the button.
use class text-center
<div class="cta-btn text-center">
<a class="btn btn-cta text-center" href="#" role="button">EXPLORE</a>
</div>
Did you try adding text-align: center;
display: block;
margin: 0 auto;

Convert Bootstrap 2.3.2 & jQuery-Spinner to work with Bootstrap 3.*

I am trying to convert xixilive's jQuery Spinner Plugin that uses Bootstrap 2.3.2 code into bootstrap 3.* Unfortunately it's not working as it should be, along with no JavaScript errors, so I believe it's just a CSS issue.
Here is what I have done so far:
HTML/CSS
<div class="input-group spinner" data-trigger="spinner">
<input type="text" value="0"
data-min="0"
data-max="10"
name="spinner"
id="spinner"
data-rule="quantity" readonly />
<span class="input-group-btn">
<!-- Up arrow -->
<a href="javascript:;" class="spin-up" data-spin="up">
<i class="fa fa-sort-up"></i>
</a>
<!-- Down arrow -->
<a href="javascript:;" class="spin-down" data-spin="down">
<i class="fa fa-sort-down"></i>
</a>
</span>
</div>
Expected output
Demo Fiddle: http://jsfiddle.net/DAS3K/
I just solved it by myself. Here is the code if anyone is looking for solution
Replace bootstrap-spinner.css file with this one:
.spinner .input-group-btn {
padding: 2px
}
.spinner .input-group-btn a.spin-up, .spinner .input-group-btn a.spin-down {
height: 10px;
overflow: hidden;
display: block;
text-align: center;
position: relative;
color: #999
}
.spinner .input-group-btn a.spin-up .fa-sort-down, .spinner .input-group-btn a.spin-down .fa-sort-down {
position: relative;
top: -9px
}
.spinner .input-group-btn a.spin-up:hover, .spinner .input-group-btn a.spin-down:hover {
color: #555
}
.spinner input {
width: 4em;
text-align: center;
font-size: 12px;
border-radius: 4px 0 0 4px;
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
line-height: 20px;
}
.spinner .input-group-btn {
background-color: #EEEEEE;
border: 1px solid #CCCCCC;
height: 20px;
line-height: 20px;
min-width: 14px;
padding: 4px 5px;
text-align: center;
text-shadow: 0 1px 0 #FFFFFF;
width: auto;
}
.spinner .input-group-btn a:focus {color: #999 !important; }
and use following HTML code
<div class="col-sm-1">
<div class="input-group spinner" data-trigger="spinner">
<input type="text" class="form-control" value="0" data-min="0" data-max="10" name="spinner" id="spinner" data-rule="quantity" >
<span class="input-group-btn">
<i class="fa fa-sort-desc"></i>
<i class="fa fa-sort-down"></i>
</span>
</div>
</div>
If you use to want use glyphicon instead of font-awesome then replace fa and fa-xxx classes in HTML and bootstrap.spinner.css file as well.
You could:
Wrap the buttons into a bootstrap add-on
Switch icon to glyphicon for the icon spinners, there's no direct suitable change though for the old to new icons thus I've adjusted for chevrons.
Swap input-group-btn to input-group-addon
This would produce HTML a little like:
<div class="input-append spinner" data-trigger="spinner">
<div class="input-group">
<input type="text" id="spinner-input" class="form-control" value="1" data-rule="quantity" />
<span class="input-group-addon">
<i class="glyphicon glyphicon-chevron-up"></i>
<br />
<i class="glyphicon glyphicon-chevron-down"></i>
</span>
</div>
</div>
I've had apply some extra CSS rules and the linebreak for the buttons could be handled instead with mini columns instead! but I hope that gives you an head-start regardless!
Result:
Demo Fiddle: http://jsfiddle.net/792hq/

Bootstrap styling issues. Styles are completely broken in ie9

As you see from the image, the styling is completely messed up in IE9. I checked bootstrap site and it appears to be compatible with all browers.
http://i.stack.imgur.com/tYnQE.png link to img for bigger version.
Below is the code I have:
html page:
<html>
<head>
...
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
...
</head>
<body>
<div id="container">
<form class="form-signin" id="frm_login">
<fieldset>
<input type="text" class="input-block-level" id="u" name="username" placeholder="Email address">
<input type="password" class="input-block-level" id="p" name="password" placeholder="Password">
Forgot Password?
<input class="btn btn-large btn-primary submitButton" id="btn_login" type="button" value="Sign In"/>
</fieldset>
</form>
</div>
</body>
</html>
the css:
.form-signin
{
max-width: 300px;
padding: 19px 29px 29px;
margin: 0 auto 20px;
background-color: #f8f8f8;
border: 1px solid #e5e5e5;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin
{
margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"]
{
font-size: 16px;
height: auto;
margin-bottom: 15px;
padding: 7px 9px;
}
.form-signin .submitButton,
.form-signin .submitButton:hover
{
margin-left: 86px;
background:#00A88F;
}
p {margin:20px 0;}
a {color:#666;}
a:hover {color: #333;}
What could be causing this problem?
ive tried all the settings i see in the ie9 debugger console. using ie9 browser mode, ie7 standard, ie8 standard looks similar to what i see in ff, ie9 standard completely breaks the styling. i was told to add in the html, but that breaks the css on ff/chrome/ie9.
You need to change
<div id="container">
to
<div class="container">

Resources