css margin in jquerymobile 1.3 button input - css

http://jsbin.com/olecad/3/edit
I am trying to move a input button by css margin-left:50%
but the button didn't move, the background moved.
Please help to guide me how to move a input button

Remove css from the input and add css for below.
.ui-btn-left, .ui-btn-right, .ui-input-clear, .ui-btn-inline, .ui-grid-a .ui-btn, .ui-grid-b .ui-btn, .ui-grid-c .ui-btn, .ui-grid-d .ui-btn, .ui-grid-e .ui-btn, .ui-grid-solo .ui-btn {
margin-left: 20%;
margin-right: 5px;
}
in jquery.mobile.css line number 2177.

Try this CSS : add text-align:center in button3 css and remove margin-left:50% from input
#buttons_1{
background:red;
}
#buttons_2{
background:green;
}
#buttons_3{
background:blue;
text-align:center;
}
#input{
margin-top:0px;
background:red;
}

Related

css multiple classes - the propper separator

Everywhere on web I found that multiple css classes use a space as separator.
So, I'm write the following:
<div class="page hidden">
css
.hidden{
display:none;
}
Using the above code .hidden IS NOT hidden, but visible.
But using:
<div class="page, hidden">
.hidden IS hidden.
Any explanation !?
You were doing everything correct. The only explanation is that you have something else affecting it that you haven't put in your question.
Just to prove it works:
div {
height:300px;
width:300px;
position:relative;
border-radius:150px;
line-height:300px;
text-align:center;
}
div div {
height:150px;
width:150px;
border-radius:75px;
position:absolute;
top:75px;
left:75px;
line-height:150px;
}
.green {
background-color:green;
}
.red {
background-color:red;
color:white;
}
.hidden {
display:none;
}
.visible:hover .hidden {
display:block;
}
<div class="green visible">
<div class="red hidden">
hidden div
</div>
hover here
</div>
the stacking order of your css will effect the styles that are applied. Also the specificity of the tags used will effect what you see from the front end.
so as an example:
/* .hidden is ignored in this example because .page comes after the hidden tag */
.hidden {display:none;}
.page {display: block;}
/* where as this will hold as it's more specific to the page, so will take a higher priority */
body .hidden{display: none;}
/* or this as it's more specific to the exact tags above */
.page.hidden {display: none;}
Just for example:
.page{ display:block}
.hidden{
display:none!important;
}
jsFiddle: https://jsfiddle.net/r1us08a3/2/

Align the content in the nav bar to the position center in bootsrap

I tried a lot but i,but unable to fix the content in the center of the navigation bar.
but can able to fix that in left or right. the following is the code i used.
<h4 class="navbar-text navbar-center">Mytitle </h4>
Try this -> JSFIDDLE DEMO
First you have to remove the generic classes of bootstrap.
We do that by resetting the float:none option !
Then we center the content using text-align:center.
CSS:
#example .navbar .nav,
#example .navbar .nav > li
{
float:none; /*To remove the inbuilt float option*/
display:inline-block;
}
#example .navbar-inner {
text-align:center;/*To center this*/
}
.navbar .brand{
float:none; /*To remove the inbuilt float option*/
}
http://jsfiddle.net/yHprm/220/ something like this but... depends if you have something else there... it will help somemore code.
.parentDiv {text-align: center}
Please try it
.navbar-text {
width: 92%; /* new edit */
text-align: center; /* new edit */
}

CSS :before not displaying

How do you get the :before pseudoclass to render properly? Do I need some special CSS to make this work?
This does not work and does not display anything:
http://jsfiddle.net/XzMH6/
HTML
<div id="test"></div>
CSS
#test:before{
width:100px; height:100px; background: #ddd;
display:block;
}
You need the content property.
#test:before{
width:100px; height:100px; background: #ddd;
display:block;
content: "";
}
http://jsfiddle.net/ULfeu/
try this
please add this content:"" in #test class then :before is working properly
Demo

Use overflow hidden to make content not wrap

I want this :
But I get this :
Using this to style the containing div :
.option {
display:inline-block;
width:100%;
white-space:nowrap;
overflow:hidden;
margin:10%;
}
The rest is nothing here : http://jsfiddle.net/n2LtN/
What is missing?
I fixed it by using display:inline-block instead of display:inline, without floating :
span, input[type="checkbox"] {
display:inline-block;
*display:inline; /*That's for IE*/
*zoom:1; /*That's for IE*/
width:auto;
}
See the working fiddle.
Remove float:left from span, input[type="checkbox"]
You should read up on how float works.

href not working with z-index -1

Helllo, I have this html code
<div class="tf">
<img src="images/facebook.png" width="2%" class="tfimg">
</div>
and for the CSS
.tf {
float:right;
margin-right:65px;
margin-top:-30px;
padding:2px;
}
.tfimg {
position:absolute;
z-index:-1;
border:none;
}
to be the image out of the border but I can't click in the image so what's the problem and what's the solution for that ?
Both of your images have the same class assigned to them. You are stacking them on top of each other by not setting them to different positions and the facebook.com one appears on top since it is last in the html. If you want them to appear beside each other you can apply something like the following:
.tftwitter {
position:absolute;
left:0px;
border:none;
}
.tffacebook {
position:absolute;
left: 20px;
border:none;
}
And now assign each image the appropriate class.
try using:
.tf{
display:inline-block;
/* your more code */
}

Resources