Html "select" position on Firefox? - html

I've got a select in my site. With the following:
...
<select name="opening-form-gender" id="opening-form-gender">
<option value="f">Female</option>
<option value="e">Male</option>
</select>
...
CSS:
#opening-form {
background-image: url('../img/opening-form-bg.png');
background-repeat: no-repeat;
height: 139px;
margin: 40px auto;
padding: 20px;
}
#opening-form p {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
color:#666666;
}
#opening-form strong {
font-size:20px;
}
#opening-form .submit {
background-image: url('../img/red-submit.png');
border: none;
width: 115px;
height: 31px;
line-height: 28px;
}
#opening-form .submit:hover {
background-image: url('../img/red-submit-hover.png');
}
So, its have a style problem. How can i fix it?
This is jsfiddle page:
http://jsfiddle.net/HLEcS/

Try something like;
select{
width: 175px;
border: 1px solid #e7e7e7;
background-image: url('../img/input-bg.png');
font-weight: regular;
font-size:12px;
color: #666666;
padding: 7px;
}
Here is the modified fiddle.

On WebKit (Chrome, Safari), you can disable the native style and customize it with your own by applying the property:
-webkit-appearance: none;
Unfortunately, this doesn't work in Gecko (Firefox). See https://bugzilla.mozilla.org/show_bug.cgi?id=649849
The dotted border on Firefox is caused by the default property outline. See How to remove Firefox's dotted outline on BUTTONS as well as links?
The alignement should be fixed by applying a vertical-align: top to the parent. Please provide the full HTML or a Fiddle to test.

Related

How to override facebook share button css

How do i override facebook shaer button css ?
Is that any way to change the sharebutton css ?
I am using asp.net and i want to change or override the facebook share button css how do i do it ?
.sp_plugin-button {
background-image: url("https://fbstatic-a.akamaihd.net/rsrc.php/v2/y1/r/LVx-xkvaJ0b.png");
background-repeat: no-repeat;
background-size: auto auto;
display: inline-block;
height: 14px;
width: 14px;
}
How do i change the image of that share button i have override this class but not worked..
You can create one like this using Font Awesome as the unique dependency:
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css
HTML
<div class="facebook-share">
<i class="fa fa-facebook-square"></i> <span>Share</span>
<div>
CSS
.facebook-share {
background-color: #3b5998;
border-radius: 3px;
height: 20px;
width: 66px;
color: white;
padding: 0 0 1px 4px;
font-family: "Lucida Grande", "Tahoma", "Helvetica", "Roboto";
font-size: 18px;
}
.facebook-share span {
font-size: 14px;
}
Here is the fiddle:
http://jsfiddle.net/yu8j5bny/
If you're referring to this button: https://developers.facebook.com/docs/plugins/share-button/
All you have to do is target the same classes that Facebook is styling to override them.
Example:
This is what Facebook is styling
.pluginCountButton {
color: #6A7180;
font-size: 11px;
line-height: 18px;
text-align: center;
white-space: nowrap;
}
override with something like:
.pluginCountButton {
color: #000;
font-size: 16px;
}
Edit: I see you've updated your question with m ore details. Facebook is using a sprite, so they are also setting the background position:
.sx_plugin-button_favblue {
background-position: 0 -42px;
}
You need to override that too.
Edit 2:
Do this:
.sp_plugin-button {
background-image: url("YourImagePathHere");
}
.sx_plugin-button_favblue {
background-position: 0 0;
}

Simple CSS issue, styling the button size

I have a button that has only one letter in it. this is the HTML for it:
<button type="button" class="clicker">X</button>
I need to resize that button to make it smaller as much as I need, and also to keep that letter following the size of the button.
I have tried the following css andit resizes the button, but the text is not following. It is either at the bottom of the button or not visible at all.
.clicker {
float: right;
font-family:"Calibri",Arial,Sans Serif;
font-size:1.0em;
line-height: 30px;
color:red;
text-align: center;
wordwrap: center;
text-shadow:1px 1px 1px #FFFFFF;
width: 30.0px;
height: 25.0px;
}
Reduce the line-height to 23px
http://jsfiddle.net/GfETQ/1/
I don't think you need font-size and line-height properties. Use vertical-align instead.
.clicker {
font-family: "Calibri", Arial, Sans Serif;
font-size: 1.0em;
color:red;
text-shadow: 1px 1px 1px #FFFFFF;
width: 30px;
height: 25px;
vertical-align: middle;
}
Fiddle:- http://jsfiddle.net/7wCLu/
It's just becuase of your line-height. Remove it and it works :)
Fiddle.
CSS:
.clicker {
float: right;
font-family:"Calibri", Arial, Sans Serif;
font-size:1.0em;
color:red;
text-align: center;
wordwrap: center;
text-shadow:1px 1px 1px #FFFFFF;
width: 30.0px;
height: 25.0px;
}
If you change to line-height: 20px; then it will center.

Can't add image to text on Bootstrap button

I'm using Bootstrap and sometimes it is hard to overwrite it.I want to add some picture to my button, near text. So I added background-image, but it doesn't apply.
Here is css for my button:
.submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background: #628d28;
background-image:url('../images/picture.png') no-repeat;
}
BUT Firebug say, that my element has next CSS:
.submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background-image: none repeat color(98,141,40);
}
Why I can't add background image ?
You define wrong background properties. Write like this:
.submit .report{
background-color: #628d28;
background-image:url('../images/picture.png');
background-repeat:no-repeat;
}
OR
.submit .report{
background: #628d28 url('../images/picture.png') no-repeat;
}

Why is Firefox button larger?

.ui_btn , .sub_txt {
margin: 2px 0px 2px 3px;
background:#181c18;
cursor: pointer;
display: inline-block;
text-align: center;
text-decoration: none;
text-transform:lowercase;
}
.ui_btn input, .sub_txt input , .disabled input{
border-spacing: 0px;
background: none;
color: #fff;
outline:0!important;
margin:0!important;
cursor: pointer;
display: inline-block;
font-weight: bold;
border: 1px solid #181c18;
font-family: Arial, sans-serif;
font-size: 11px;
padding: 7px 6px!important;
white-space: nowrap;
text-transform:lowercase;
line-height: 12px!important;
}
And this is my button:
<label id="SD_mrs_t" class="ui_btn" for="SD_mrs">
<input id="SD_mrs" value="More Specific" type="button"/>
</label>
As a result button in Firefox has something like:
padding: 9px 8px!important;
Is there any solution without definition of special parameters for Mozilla browser?
Firefox applies a special padding to buttons, which you can address like this:
button::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner {
padding: 0 !important;
border: 0 none !important;
}
In Firefox, the input button has more padding, this might help to resolve it:
/* Remove button padding in FF */
button::-moz-focus-inner {
border:0;
padding:0;
}
Also, this question seems more or less the same (above code is suggested there): CSS: Size of buttons in Chrome is different than Firefox
If you use a reset.css in your stylesheet, it can set the default values for all browsers on load, then the firefox button wouldn't be bigger. I use this one:
http://meyerweb.com/eric/tools/css/reset/

margin: 0 auto; not working when linked to external css

When I linked to my external style-sheet, it seems my wrapper styles are broken. If I paste the styles into the head on my index.html, it works just fine, but not when linking to a .css. All other css rules work perfectly either way, only the wrapper style appears to break.
The only rule applied to the wrapper is to center it within the browser, so if there is another reasonable way to accomplish this I'm all ears.
the wrapper css:
#wrapper {
width: 960px;
margin: 0 auto;
}
and the html (minus content):
<body>
<div id="wrapper">
<div id="header">
</div>
<div id="nav">
</div>
<div id="content">
<div id="cont_left">
</div>
<div id="cont_right">
</div>
</div>
<div id="footer">
</div>
</div>
</body>
Any help or advice would be great.
EDIT: here is the full css:
#wrapper {
width: 960px;
margin: 0 auto;
}
#header {
width: 960px;
height: 144px;
background-image: url(../images/header.jpg);
background-repeat: repeat-x;
margin-bottom: -14px;
}
#logo {
margin-right: 48px;
margin-top: 33px;
float: right;
}
#logo a img {
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
#tagline {
margin-top: 90px;
margin-left: 48px;
float: left;
clear: both;
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-style: normal;
color: #CCC;
}
#nav {
width: 960px;
height: 48px;
background-image: url(../images/nav_bar.jpg);
background-repeat: repeat-x;
}
#nav_bar {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: bold;
margin-left: -50px;
padding-top: 14px;
}
#nav_bar li {
display: inline;
padding-left: 58px;
}
#nav_bar li a {
text-decoration: none;
color: #999;
padding: 4px;
}
#nav_bar li a:hover {
color: #fff;
background-color: #666;
}
.current {
color: #CCC;
}
#content {
float: left;
width: 960px;
background-image: url(../images/content.jpg);
background-repeat: repeat-x;
}
#cont_left {
width: 40%;
margin: 48px;
float: left;
}
#cont_right {
width: 40%;
margin: 48px;
float: right;
}
#footer {
clear: both;
height: 48px;
width: 960px;
background-image: url(../images/footer.jpg);
background-repeat: repeat-x;
}
#footer_list {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666;
font-style: normal;
text-align: center;
padding-top: 16px;
}
#footer_list li {
display: inline;
padding: 18px;
}
#footer_list li a {
text-decoration: none;
color: #666;
padding: 4px;
}
#footer_list li a:hover {
color: #000;
text-decoration: underline;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 48px;
line-height: 20px;
font-weight: normal;
margin: 0px;
padding-top: 0px;
padding-bottom: 12px;
}
p {
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
}
body {
background-image: url(../images/background.jpg);
background-repeat: repeat-x;
}
EDIT TO ADD: Website is not live, therefore I have no link to provide, sorry. Still in early development stages, got stuck on this issue.
What browser are you using? I've just tried your sample in IE8 and it won't centre at all unless I include the XHTML doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
No idea why, or if you have this or not, but it may help.
View source of the page you are using and click on the CSS document you link you have linked. It should pull up a CSS page with your styles, if not, you're either 1) not linking it correctly or 2) there is a permissions issue on the server.
ADD: Check it in developer tools (F12 -> IE, left-click>inspect Element -> chrome, Firefox).
It will not make a difference whether your css rule is in an external stylesheet or in a <style> tag in head. Things to try;
Validate your css file (will inform you of typos) http://jigsaw.w3.org/css-validator/
Do you have multiple css files? If so, try to include this stylesheet last.
Use firebug (or chrome inspector if you prefer) to inspect your #wrapper element, to see if your definition show up at all (and if its overruled and by what).
I would love to see your entire solution if possible, so i can poke around :)
I have never had this problem before. You may not have the link correct
Make sure that you attached you style sheet correctly:
<link href="Default.css" rel="stylesheet" type="text/css" />
If it is in a folder (say Styles for ex):
<link href="Styles/Default.css" rel="stylesheet" type="text/css" />
If your webpage is in a folder then you need to add "../" to the front
<link href="../Styles/Default.css" rel="stylesheet" type="text/css" />
You can also try !important
#wrapper {
width: 960px;
margin: 0 auto !important;
}
If that does not work, then right click the wrapper element and click "inspect element" in chrome. This will show you all applied css on that element, and what has been over written by what. This will give you a better idea of what is actually going on (downloading Firebug for firefox is also helpful)