I am using wordpress and some plugin theme.Currently my default template contain this attribute.
html {
margin-top: 32px !important;
}
I need to set it to margin 0px.How to override it? I tried to set in in my specific css but can't.
!important carries the highest level of specificity.
As such, there are only two ways to overwrite it:
Add another !important declaration later on in the stylesheet: html { margin-top: 0; }
html {
background: red !important;
}
html {
background: blue !important;
}
<html></html>
Or add an inline !important declaration: <html style="margin-top: 0 !important;">
html {
background: red !important;
}
<html style="background: blue !important;"></html>
If you put your custom css file below template default css file then browser will affected below css first so template css properties will be replaced by your custom css. so you can write
html {
margin-top: 100px !important;
background-color:red !important;
}
html {
margin-top: 0 !important;
background-color:blue !important;
}
<html>
<h1> hello</h1>
</html>
I am not that familiar with CSS and have a very basic question. I simply want to remove right and left padding from the following "div":
<div id="__grid2" data-sap-ui="__grid2" class="noPaddingRightLeft sapUiRespGrid sapUiRespGridHSpace1 sapUiRespGridMedia-Std-LargeDesktop sapUiRespGridVSpace1">
"sapUixxx" classes are provided by a framework and cannot be adjusted directly. Therefore I declared a new css class "noPaddingRightLeft" and added it to the div:
.sapUiRespGridHSpace1 .noPaddingRightLeft{
padding: 0 0; }
When I check the result in the Chrome debugger tools it looks like this:
CSS at Runtime
There is no sign of my class "noPaddingRightLeft" though it's in the class list of the element. How can I override sapUixxx css files correctly?
Thanks for help
Tobias
Add the important flag to your css
.class {
padding-right: 0 !important;
padding-left: 0 !important;
}
Do:
<div id="__grid2" data-sap-ui="__grid2" class="noPaddingRightLeft sapUiRespGrid sapUiRespGridHSpace1 sapUiRespGridMedia-Std-LargeDesktop sapUiRespGridVSpace1" style = "padding: 0">
Or create the css class as following:
#__grid2{
padding: 0 !important;
}
Add this to your css:
.sapUiRespGrid.sapUiRespGridHSpace1 {
padding: 0;
}
Whole code : http://jsfiddle.net/o3omng/Vh3u9/
<div id="as_profile" class="div_clearboth"></div>
<div id="as_notice" class="div_clearboth"></div>
In the HTML code, #as_profile and #as_notice are
both have class="div_clearboth" attribute.
.div_clearboth { clear : both ;
margin-bottom : 10px ; }
In the CSS code,
I give clear:both style and margin-bottom : 10px style to div_clearboth attribute.
It works well in other div tags,
but It doesn't work well in #as_profile.
Check the jsfiddle. Then you can see that there is no space between #as_profile and #as_notice.
They must be 10px away. How can I fix it?
Whole code : http://jsfiddle.net/o3omng/Vh3u9/
<s_somethig> tag and [##something##] are going to replace by server automatically.
You can correct it by giving #as_profile an overflow value besides visible:
#profile_control {
overflow: hidden;
}
Or changing display to inline block:
#profile_control {
display: inline-block;
}
Or giving it padding/border:
#profile_control {
padding: 1px 0 0 0;
}
As #sevenseacat pointed out, the culprit is the floated li's within #as_profile
CSS :
#as_profile {
padding-bottom:20px;
}
Can you use Padding for divide? It works for me.
Jsfiddle
Here is the code I have so far:
HTML:
<!DOCTYPE html>
...
<form>
<input type="image" value=" " class="btnimage" />
</form>
...
CSS:
.btnimage {
width: 80px;
height: 25px;
background:url('C:/Users/John/Desktop/Misc Things for the CoD Ghosts Site/SubmitButton.png');
}
.btnimage:hover {
background-position: 0 -25px;
background:url('C:/Users/John/Desktop/Misc Things for the CoD Ghosts Site/SubmitButtononHover.png');
}
The above code works, but there's a border that surrounds the button, which I want to go away. So far, I've tried adding background-border:0; to both of the classes, and it did not work.
try
input {
/* sets border width to 0 and border style to none */
border:0 none;
}
or
input {
border: 0px solid black;
}
background-border is not a css property
You can remove a border with css by setting it's width to 0 or it style to none.
To avoid an internet explorer legacy bug, you have to specify a border-width or a border-color to make border-style:none apply. So your best bet if you care about my grandma, it to use border:0 none;
.btnimage {
border: 0 none;
width: 80px;
height: 25px;
background:url('C:/Users/John/Desktop/Misc Things for the CoD Ghosts Site/SubmitButton.png');
}
Since you did not mention when your border is visible, perhaps it an outline visible on your input focus.
If it is your case, add :
.btnimage:focus {
outline:0
}
input {
border:0 none !important;
outline:0 !important;
}
The main problem here is that you define an input type="image", but not provide a source, so this border is like a broken image, because when you set the type as image the input expects an src attribute as well.
In my opinion you have 2 solutions:
1st: set the "src" property of the input, in the HTML code, and if you want to change the hover image, you can do this through javascript.
<!DOCTYPE html>
...
<form>
<input type="image" src="your_image_url" class="btnimage" />
</form>
...
2nd: change it to input type "button", or a link " ", than remove border and background in the CSS.
<!DOCTYPE html>
...
<form>
<input type="button" class="btnimage" />
</form>
...
Sample: http://jsfiddle.net/Bpv34/
CSS
border:none none;
Yes working
To remove the border, write the following line in your CSS wherever the border appears:
outline: 0;
try the prefixes too
input {
border:0 none;
-moz-border:0 none;
-webkit-border:0 none;
outline: 0; //add this too
}
try this
input {
border:0 none !important;
}
by writing important it will definately work.
1) Use src attribute to define image url.
2) Use custom button with div - something like:
<div class="btnimage" onclick="blablabla()">Button</div>
It can solve the problem.
This finally worked for me. All attempts with "border" did not work:
input { outline: 0 !important; }
I was just having trouble with this too.
First off, you may as well set the src equal to an image you want to use if you are using the input type of 'image'
Here is mine: <input type='image' src='img/share.png' alt='Share'>
Then make adjustments in your css:
#fbshare input[type="image"] {outline:none;}
#fbshare input[type="image"]:active {outline:none;}
This solved my problem in Chrome, and I presume it should solve yours too. If it is still a problem nearly 2 years later. (I mostly posted this for others who find this page in a google search)
This page helped me come to the above conclusion.
http://themeforest.net/forums/thread/remove-border-after-clicking-button/33948
I was having the same problem as the OP - specifically for an image input. It certainly seems to be because of the browser interpreting it as a "broken image" if no src attribute is set.
So this works as a solution, by setting the attribute to a single transparent pixel, the image input non-border non-outline "border" goes away:
<input type="image" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="btnimage">
No CSS needed (or seems to work.)
I am having a bit of a problem styling the commandbutton of the primefaces 3 application.
My common CSS has this style
body {
font-size: small;
}
and my primefaces button has this
<p:commandButton value="Search" ajax="false" style="padding:0px;"/>
I wanted to remove some padding on the button itself so I have set its style as above.
But nothing is happening?
Is there a way to remove the excess padding on command button?
Thanks
The css class that is responsible for the padding is .ui-button-text. You can verify it with Firebug or some other tool.
You could override this default style with the following code snippet. Put it in the header section of your page:
<style type="text/css">
.ui-button-text {
padding: 0px !important;
}
</style>
Not sure why, but in my case this was not working.
Alternative way is using display:none; as shown below.
<style type="text/css">
.ui-button-text {
display:none;
}
</style>