styling google's new recaptcha checkbox? - html

I've implemented Googles new recaptcha checkbox like so:
<div class="g-recaptcha" data-sitekey="MY_SITE_KEY"><div>
When loaded the iframe contents look like this:
<div class="rc-anchor rc-anchor-standard">
...
</div>
Here are the styles defined for the current look:
.rc-anchor-standard {
background: #f9f9f9;
border: 1px solid #d3d3d3;
color: #000;
}
I'm trying to achieve this look:
I've added this to my css file:
.rc-anchor-standard {
background: #ffffff !important;
border: 0px !important;
color: #ffffff !important;
}
The style never changes...any thoughts why this isn't working?
Thanks,
-Paul

These styles are located inside a iframe from another domain (google.com), so no chances to change them due to same-domain policy...
You can scale the contents of your div with recaptcha (<div id="g-recaptcha" ... )
#g-recaptcha {
transform: scale(1.42);
transform-origin: 0 0 0;
}

First things first, you forgot a semicolon ';' after border,
border: 0px !important
perhaps that is canceling the white text and border code. I would fix that and see if anything changes.
========================================
If this isn't another typo, this may be why:
You are calling 2 seperate div classes here, but you have them written as a div inside a div.
.rc-anchor .rc-anchor-standard {
Replace that ^ with this v:
.rc-anchor, .rc-anchor-standard {

Related

Is there a way to make the <hr> tag a different color? [duplicate]

I want to change the color of my hr tag using CSS. The code I've tried below doesn't seem to work:
hr {
color: #123455;
}
I think you should use border-color instead of color, if your intention is to change the color of the line produced by <hr> tag.
Although, it has been pointed in comments that, if you change the size of your line, border will still be as wide as you specified in styles, and line will be filled with the default color (which is not a desired effect most of the time). So it seems like in this case you would also need to specify background-color (as suggested by #Ibu).
HTML 5 Boilerplate project in its default stylesheet specifies the following rule:
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
An article titled “12 Little-Known CSS Facts”, published recently by SitePoint, mentions that <hr> can set its border-color to its parent's color if you specify hr { border-color: inherit }.
border-color works in Chrome and Safari.
background-color works in Firefox and Opera.
color works in IE7+.
I think this can be useful. this was simple CSS selector.
hr { background-color: red; height: 1px; border: 0; }
<hr>
hr {
height: 1px;
color: #123455;
background-color: #123455;
border: none;
}
Doing it this way allows you to change the height if needed. Good luck. Source: How To Style HR with CSS
Tested in Firefox, Opera, Internet Explorer, Chrome and Safari.
hr {
border-top: 1px solid red;
}
See the Fiddle.
Only border-top with color is enough to make the line in different color.
hr {
border-top: 1px solid #ccc;
}
<hr>
This will keep the Horizontal Rule 1px thick while also changing the color of it:
hr {
height: 0;
border: 0;
border-top: 1px solid #083972;
}
hr {
color: #f00;
background-color: #f00;
height: 5px;
}
After reading all the answers here, and seeing the complexity described, I set upon a small diversion for experimenting with HR. And, the conclusion is that you can throw out most of the monkeypatched CSS you wrote, read this small primer and just use these two lines of pure CSS:
hr {
border-style: solid;
border-color: cornflowerblue; /* or whatever */
}
That is ALL you need to style your HRs.
Works cross-browser, cross-device, cross-os, cross-english-channel, cross-ages.
No "I think this will work...", "you need to keep Safari/IE in mind...", etc.
no extra css - no height, width, background-color, color, etc. involved.
Just bulletproof colourful HRs. It's that simpleTM.
Bonus: To give the HR some height H, just set the border-width as H/2.
I believe this is the most effective approach:
<hr style="border-top: 1px solid #ccc; background: transparent;">
Or if you prefer doing it on all hr elements write this on you CSS:
hr {
background-color: transparent;
border-top: 1px solid #ccc;
}
hr {
background-color: #123455;
}
The background is the one you should try to change.
You can also work with the borders color. I am not sure; I think there are cross-browser issues with this. You should test it in different browsers.
You can add bootstrap bg class like
<hr class="bg-light" />
if u use css class then it will be taken by all 'hr' tags , but if u want for a particular 'hr' use the below code i.e, inline css
<hr style="color:#99CC99" />
if it's not working in chrome try below code:
<hr color="red" />
Some browsers use the color attribute and some use the background-color attribute. To be safe:
hr {
color: #color;
background-color: #color;
}
It's simple and my favorite.
<hr style="background-color: #dd3333" />
I'm testing on IE, Firefox and Chrome May 2015 and this works best with the current versions. It centers the HR and makes it 70% wide:
hr.light {
width:70%;
margin:0 auto;
border:0px none white;
border-top:1px solid lightgrey;
}
<hr class="light" />
You should set border-width to 0; It works well in Firefox and Chrome.
hr {
clear: both;
color: red;
background-color: red;
height: 1px;
border-width: 0;
}
<hr />
This is a test
<hr />
Since i don't have reputation to comment, i will give here a few ideas.
if you want a css variable height, take off all borders and give a background color.
hr{
height:2px;
border:0px;
background:green;
margin:0px;/*sometimes useful*/
}
/*Doesn't work in ie7 and below and in Quirks Mode*/
if you want simply a style that you know that will work (example: to replace a border in a ::before element for most email clients or
hr{
height:0px;
border:0px;
border-top:2px solid blue;
margin:0px;/*useful sometimes*/
}
In both ways, if you set a width, it will always have it's size.
No need to set display:block; for this.
To be totally safe, you can mix both, 'cause some browsers can get confused with height:0px;:
hr{
height:1px;
border:0px;
background:blue;
border-top:1px solid blue;
margin:0px;/*useful sometimes*/
}
With this method you can be sure that it will have at least 2px in height.
It's a line more, but safety is safety.
This is the method you should use to be compatible with almost everything.
Remember: Gmail only detects inline css and some email clients may not support backgrounds or borders. If one fails, you will still have a 1px line. Better than nothing.
In the worst cases, you can try to add color:blue;.
In the worst of the worst cases, you can try to use a <font color="blue"></font> tag and put your precious <hr/> tag inside it. It will inherit the <font></font> tag color.
With this method, you WILL want to do like this: <hr width="50" align="left"/>.
Example:
<span>
awhieugfrafgtgtfhjjygfjyjg
<font color="#42B3E5"><hr width="50" align="left"/></font>
</span>
<!--Doesn't work in ie7 and below and in Quirks Mode-->
Here is a link for you to check: http://jsfiddle.net/sna2D/
You can use CSS to make a line with a different color, example would be like that:
border-left: 1px solid rgb(216, 216, 216);
border-right: medium none;
border-width: medium medium medium 2px;
border-style: none none none solid;
border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(216, 216, 216);
that code will display vertical grey line.
I like the answers setting border-top, but they are somehow still a little off in Chrome...
BUT if I set border-top: 1px solid black; and border-bottom: 0px; I end up with a truly single line (that also works fine with higher thickness).
Well, I am new in HTML, CSS and in Java but I tried my way which worked for me in all browsers. I have used JS instead of CSS which doesn't work with some browsers.
First of all I have given id="myHR" to HR element and used it in Java Script.
Here is the Code.
x = document.getElementById("myHR");
y = x.style.width = "600px";
y = x.style.color = "white";
y = x.style.height = "2px";
y = x.style.border = "none";
y = x.style.backgroundColor = "lightgrey";
Code Works For older IE
Tried For Many Colors
<hr color="black">
<hr color="blue">
Using font colours to modify horizontal rules makes them more flexible and easy to use.
The color property isn't inherited by default, so the following needs to be added to hr's to allow color inheritance:
/* allow hr to inherit color */
hr { border: 1px solid;}
/* reusable colour modifier */
.fc_-alpha { color: crimson;}
normal hr:
<hr>
hr with <span class="fc_-alpha">colour modifier</span>:
<hr class="fc_-alpha">
You could do this :
hr {
border: 1px solid red;
}
<hr />
This s a test
<hr />
You can give the <hr noshade> tag and go to your css file and add :
hr {
border-top:0;
color: #123455;
}
<hr noshade />
This s a test
<hr noshade />
As a general rule, you can’t just set the color of a horizontal line with CSS like you would anything else.
First of all, Internet Explorer needs the color in your CSS to read like this:
“color: #123455”
But Opera and Mozilla needs the color in your CSS to read like this:
“background-color: #123455”
So, you will need to add both options to your CSS.
Next, you will need to give the horizontal line some dimensions or it will default to the standard height, width and color set by your browser.
Here is a sample code of what your CSS should look like to get the blue horizontal line.
hr {
border: 0;
width: 100%;
color: #123455;
background-color: #123455;
height: 5px;
}
Or you could just add the style to your HTML page directly when you insert a horizontal line, like this:
<hr style="background:#123455" />
Hope this helps.
I took a bet each way:
hr {
border-top: 1px solid purple;
border-color: purple;
background-color: purple;
color: purple;
}

Focus outline appears after padding in firefox

I have the following style class for button -
.buttonStyleClass {
padding:5px 20px;
}
When I try to focus the button in Firefox, then focus outline is appearing inside the button after padding. But when you verify the same in Chrome you will find the focus to entire button including padding.
In my application focus outline seems to odd in firefox since it is appearing 20 pixels inside of button.
Is there any CSS fix for this issue ?
Thanks,Gopal
Actually in both Firefox and Chrome I see the outline OUTSIDE of the button... Check out this fiddle. You can easily hide the outline though:
.buttonStyleClass { outline: 0; }
If this is not the answer; could you provide us with a fiddle or screenshot of what you mean?
edit
It's probably a bit OS-specific, as I only saw the dotted (inner) outline when I added a explicit border to the button (button { border: 1px solid red; }).
You can remove, or alter, the outline with the :-moz-focus-inner selector, like this:
button::-moz-focus-inner { border:0; padding: 0; }
Also check out the updated fiddle
I realize this is a very old question, but no one has actually answered the question yet, and several people have given bad advice. Given I got here via Google, other people may come here and leave with that bad advice.
For accessible reasons, you should never remove styling like this, unless you replace it with something better.
Instead of:
button::-moz-focus-inner {
border:0;
padding: 0;
}
Try:
button::-moz-focus-inner {
padding: inherit;
}
Try out this
button { padding: 10px; border: 1px solid red;}
button.no-outline { border: 1px solid blue; }
button.no-outline::-moz-focus-inner { outline: none; border:0; padding: 0; }
button.better-outline {border: 1px solid green; }
button.better-outline::-moz-focus-inner { padding: inherit; }
<button>my button</button>
<button class="no-outline">without outline</button>
<button class="better-outline">with better outline</button>
Add this to your CSS.
.buttonStyleClass:active {
outline: 0;
}
Are you viewing this in a web browser? You said 'application' in your query.
If I understand correctly you are saying that:
Chrome : outlines around the button area inside padding.
Firefox : outlines the area outside padding.
This is a browser specific rendering problem.
Two solutions come to mind.
Don't use padding for you button instead use:
.buttonStyleClass {
height:50px;
line-height:50px;
text-align:center;
}
Alternatively use -webkit targeting to write specific browser css markup.
http://jsfiddle.net/JV6MH/4/
This fiddle should render focus outline the same in both firefox and chrome by avoiding the use of padding on buttons.

HTML + CSS tab bar

How do I cleanly style a HTML + CSS horizontal tab bar so that the tab bar has a line across the bottom that's hidden or suppressed for the active tab?
In other words, I'm trying to do the same thing that StackOverflow does for its tags:
My tab bar is set up as an ordered list with
ul
{
list-style: none;
}
li
{
float: left;
}
Update: I've already poked around sites with Firebug to see how they do it, but I feel like I quickly get bogged down in details. For example, StackOverflow's version has a border for the bottom of the whole div (which makes sense), and a white border for the bottom of the active tab (which makes sense), but then it makes the active tab's border overlap the div's border (and I'm not very clear on how it does that). It looks like Twitter Bootstrap does something similar. I'm trying to understand the general concept of how overlapping part of a container's border with the content's border works instead of copying and tinkering with CSS until I get something that appears to work.
All you need to do is put a bottom border on the <ul> (so that it stretches across) and then give the <li>'s a selected class, and make that one have a 1-pixel higher height.
Here is a very simple example: http://jsfiddle.net/V6gzS/
ok to point you in the right direction use firebug or chromes element inspector and just pick out the bits you need, so on this site for example what you are looking for are called tabs and they are styled like so
#tabs a.youarehere {
background: #fff;
border: 1px solid #ccc;
border-bottom-color: #ffffff;
color: black;
font-size: 120%;
height: 30px;
line-height: 28px;
margin-top: 3px;
padding: 0px 11px 0px 11px;
}
this is just a part of it but you can learn a lot by looking at some code
As I understand it you are capable of making the buttons by yourself, with the horizontal bottom line.
If that is the case, then make sure that this horizontal line is made as a border-bottom: solid 1px #CCC property on each button (the color might be different). At each page you then add the id id="current" to that one button that is the active page. In CSS you write:
#current {
border: solid 1px #CCC;
border-bottom: 1px solid white;
}
If you have any problems it might be solved by adding !important like this:
border-bottom: 1px solid white !important;
Therefore, this is just four extra lines of code in CSS and one extra HTML attribute in each of the files.
If dynamic menu
If you have a menu that is not static on every page, but maybe dynamically generated or placed in an included file, then the above will not be possible. Because then you can't easily add the new id on each seperate page.
In that case you might do some dynamic adding of the attribute. If a server side language is used, e.g. PHP, then you might be able to easily set up an if{...} command that checks the URL or a GET request or alike. Else you might use some javascript to check each button and add the attribute id if the button text equals some header on the page.
I hope you understand. Good luck.
I did it like this:
ul {
list-style-type:none;
}
li{
float: left;
border-bottom: 1px solid #CCC;
}
li:hover{
float: left;
border: solid 1px #CCC;
border-bottom:none;
}

Changing the color of an hr element

I want to change the color of my hr tag using CSS. The code I've tried below doesn't seem to work:
hr {
color: #123455;
}
I think you should use border-color instead of color, if your intention is to change the color of the line produced by <hr> tag.
Although, it has been pointed in comments that, if you change the size of your line, border will still be as wide as you specified in styles, and line will be filled with the default color (which is not a desired effect most of the time). So it seems like in this case you would also need to specify background-color (as suggested by #Ibu).
HTML 5 Boilerplate project in its default stylesheet specifies the following rule:
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
An article titled “12 Little-Known CSS Facts”, published recently by SitePoint, mentions that <hr> can set its border-color to its parent's color if you specify hr { border-color: inherit }.
border-color works in Chrome and Safari.
background-color works in Firefox and Opera.
color works in IE7+.
I think this can be useful. this was simple CSS selector.
hr { background-color: red; height: 1px; border: 0; }
<hr>
hr {
height: 1px;
color: #123455;
background-color: #123455;
border: none;
}
Doing it this way allows you to change the height if needed. Good luck. Source: How To Style HR with CSS
Tested in Firefox, Opera, Internet Explorer, Chrome and Safari.
hr {
border-top: 1px solid red;
}
See the Fiddle.
Only border-top with color is enough to make the line in different color.
hr {
border-top: 1px solid #ccc;
}
<hr>
This will keep the Horizontal Rule 1px thick while also changing the color of it:
hr {
height: 0;
border: 0;
border-top: 1px solid #083972;
}
hr {
color: #f00;
background-color: #f00;
height: 5px;
}
After reading all the answers here, and seeing the complexity described, I set upon a small diversion for experimenting with HR. And, the conclusion is that you can throw out most of the monkeypatched CSS you wrote, read this small primer and just use these two lines of pure CSS:
hr {
border-style: solid;
border-color: cornflowerblue; /* or whatever */
}
That is ALL you need to style your HRs.
Works cross-browser, cross-device, cross-os, cross-english-channel, cross-ages.
No "I think this will work...", "you need to keep Safari/IE in mind...", etc.
no extra css - no height, width, background-color, color, etc. involved.
Just bulletproof colourful HRs. It's that simpleTM.
Bonus: To give the HR some height H, just set the border-width as H/2.
I believe this is the most effective approach:
<hr style="border-top: 1px solid #ccc; background: transparent;">
Or if you prefer doing it on all hr elements write this on you CSS:
hr {
background-color: transparent;
border-top: 1px solid #ccc;
}
hr {
background-color: #123455;
}
The background is the one you should try to change.
You can also work with the borders color. I am not sure; I think there are cross-browser issues with this. You should test it in different browsers.
You can add bootstrap bg class like
<hr class="bg-light" />
if u use css class then it will be taken by all 'hr' tags , but if u want for a particular 'hr' use the below code i.e, inline css
<hr style="color:#99CC99" />
if it's not working in chrome try below code:
<hr color="red" />
Some browsers use the color attribute and some use the background-color attribute. To be safe:
hr {
color: #color;
background-color: #color;
}
It's simple and my favorite.
<hr style="background-color: #dd3333" />
I'm testing on IE, Firefox and Chrome May 2015 and this works best with the current versions. It centers the HR and makes it 70% wide:
hr.light {
width:70%;
margin:0 auto;
border:0px none white;
border-top:1px solid lightgrey;
}
<hr class="light" />
You should set border-width to 0; It works well in Firefox and Chrome.
hr {
clear: both;
color: red;
background-color: red;
height: 1px;
border-width: 0;
}
<hr />
This is a test
<hr />
Since i don't have reputation to comment, i will give here a few ideas.
if you want a css variable height, take off all borders and give a background color.
hr{
height:2px;
border:0px;
background:green;
margin:0px;/*sometimes useful*/
}
/*Doesn't work in ie7 and below and in Quirks Mode*/
if you want simply a style that you know that will work (example: to replace a border in a ::before element for most email clients or
hr{
height:0px;
border:0px;
border-top:2px solid blue;
margin:0px;/*useful sometimes*/
}
In both ways, if you set a width, it will always have it's size.
No need to set display:block; for this.
To be totally safe, you can mix both, 'cause some browsers can get confused with height:0px;:
hr{
height:1px;
border:0px;
background:blue;
border-top:1px solid blue;
margin:0px;/*useful sometimes*/
}
With this method you can be sure that it will have at least 2px in height.
It's a line more, but safety is safety.
This is the method you should use to be compatible with almost everything.
Remember: Gmail only detects inline css and some email clients may not support backgrounds or borders. If one fails, you will still have a 1px line. Better than nothing.
In the worst cases, you can try to add color:blue;.
In the worst of the worst cases, you can try to use a <font color="blue"></font> tag and put your precious <hr/> tag inside it. It will inherit the <font></font> tag color.
With this method, you WILL want to do like this: <hr width="50" align="left"/>.
Example:
<span>
awhieugfrafgtgtfhjjygfjyjg
<font color="#42B3E5"><hr width="50" align="left"/></font>
</span>
<!--Doesn't work in ie7 and below and in Quirks Mode-->
Here is a link for you to check: http://jsfiddle.net/sna2D/
You can use CSS to make a line with a different color, example would be like that:
border-left: 1px solid rgb(216, 216, 216);
border-right: medium none;
border-width: medium medium medium 2px;
border-style: none none none solid;
border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(216, 216, 216);
that code will display vertical grey line.
I like the answers setting border-top, but they are somehow still a little off in Chrome...
BUT if I set border-top: 1px solid black; and border-bottom: 0px; I end up with a truly single line (that also works fine with higher thickness).
Well, I am new in HTML, CSS and in Java but I tried my way which worked for me in all browsers. I have used JS instead of CSS which doesn't work with some browsers.
First of all I have given id="myHR" to HR element and used it in Java Script.
Here is the Code.
x = document.getElementById("myHR");
y = x.style.width = "600px";
y = x.style.color = "white";
y = x.style.height = "2px";
y = x.style.border = "none";
y = x.style.backgroundColor = "lightgrey";
Code Works For older IE
Tried For Many Colors
<hr color="black">
<hr color="blue">
Using font colours to modify horizontal rules makes them more flexible and easy to use.
The color property isn't inherited by default, so the following needs to be added to hr's to allow color inheritance:
/* allow hr to inherit color */
hr { border: 1px solid;}
/* reusable colour modifier */
.fc_-alpha { color: crimson;}
normal hr:
<hr>
hr with <span class="fc_-alpha">colour modifier</span>:
<hr class="fc_-alpha">
You could do this :
hr {
border: 1px solid red;
}
<hr />
This s a test
<hr />
You can give the <hr noshade> tag and go to your css file and add :
hr {
border-top:0;
color: #123455;
}
<hr noshade />
This s a test
<hr noshade />
As a general rule, you can’t just set the color of a horizontal line with CSS like you would anything else.
First of all, Internet Explorer needs the color in your CSS to read like this:
“color: #123455”
But Opera and Mozilla needs the color in your CSS to read like this:
“background-color: #123455”
So, you will need to add both options to your CSS.
Next, you will need to give the horizontal line some dimensions or it will default to the standard height, width and color set by your browser.
Here is a sample code of what your CSS should look like to get the blue horizontal line.
hr {
border: 0;
width: 100%;
color: #123455;
background-color: #123455;
height: 5px;
}
Or you could just add the style to your HTML page directly when you insert a horizontal line, like this:
<hr style="background:#123455" />
Hope this helps.
I took a bet each way:
hr {
border-top: 1px solid purple;
border-color: purple;
background-color: purple;
color: purple;
}

Why does placing this html within form tags change the layout?

I'm using this free Web Template - EliteCircle and have just incorporated it into a master page. The master page wraps the html in:
<form id="form1" runat="server">
//master page html
</form>
The template almost comes out fine except the entire page is surrounded by a think white border (default CSS behavior for form?) and the footer background is half white on the very bottom.
I wouldn't expect the form with id=form1 to change anything in the layout. There is nothing in the [CSS][2] with that id.
When I remove the form tags from the master page (just to check) the layout is perfect, no problems.
Any ideas?
(Using Visual Web Developer 2008 Express)
Thanks,
Greg
The CSS: http://www.styleshout.com/templates/preview/EliteCircle12/images/EliteCircle.css
Have you seen the
/* form elements */
form {
margin: 15px;
padding: 15px 5px;
border: 1px solid #EFEFEF;
background: #F8F8F8;
}
declaration in your CSS file? That might just explain the thick white border and other stuff you mention :)
Either change that declaration to form.myForm (and change all forms that need it), or re-cascade the form1 id or interior tags on your page to override those settings.
I agree with Konerak, but a word of advice, don't set properties to html elements in a generic way, instead, use classes...
Your css:
/* form elements */
form {
margin: 15px;
padding: 15px 5px;
border: 1px solid #EFEFEF;
background: #F8F8F8;
}
The sugestted:
form.standard {
margin: 15px;
padding: 15px 5px;
border: 1px solid #EFEFEF;
background: #F8F8F8;
}
If you set the css to the form element, all forms in your page will receive does properties, but if you set does properties to a class, only form's with that class will receive then...
Btw: DocType may also interfere with the desired result...