How to make my header looks better on Mobile - css

Heres my problem how can i make my header looks better
Following is the coding ...!!
1 Index.php
<div class="header">
<div class="headerFont">Yo! Yo! Honey Singh..!!
</div>
<div class="Login">
<form>
Email :<input type="text">
Password :<input type="password">
<input type="submit" value="Login" >
<input type="button" value="register">
</form>
</div>
</div>
2 Web-Style.css
.header{
top:0;
left:0;
padding:10px;
background:#00688B;
width:100%;
height:footer-<length>;
box-shadow:2px 2x 5px #08298A;
border:1px solid black;
text-shadow:2px 2px black;
}
.header a{
color:white;
}
.headerFont{
font-family:MATURA MT ;
font-size:22px;
display:table-cell;
}
.Login{
display:block;
position:absolute;
top:15px;
right:50px;
}
3 Mobile-Style.css
.header {
width: auto;
}
Now i need to know how can i get button like the website[PIC] -> http://i.stack.imgur.com/vlx09.png
How do i make button visible on mobile but not on pc borwsers ..???

Create the button you want on the mobile version of the website.
Add CSS that makes the button invisible (eg, display: none).
Use CSS with media queries to show the button on mobile devices.
More details here:
http://mobile.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

you can do this using javascript and checking the requesting browser's type.
You can detect mobile broswer's request using javascript like following.
if ((screen.width < 480) || (screen.height < 480)) {
location.replace('/mobile/');
/*Get buggon element by id and show it else hide it*/
}
or may be you can use following javascript to detent mobile browser and then hide the button.
https://github.com/miohtama/detectmobile.js

Related

how to change css modal box graphic display width?

I have a picture that, when clicked, opens up a css js modal box of another picture. Right now the box is too small. How do I edit the width of the graphic that appears?
http://www.awastudios.net (click one of the comic book covers)
I tried to edit the css code (app.css) but nothing changes.
.creator-modal {
background:#20212a;
border:1px solid #3f4150;
padding:0;
max-width:700px;
}
#media screen and (max-width:63.99875em) {
.creator-modal{
max-width:95%;
min-height:inherit;
height:auto;
margin:auto;
}
}
.reveal-overlay{
background-color:rgba(0,0,0,.45);
}
.regular-modal{
padding:15px;
font-size:14px;
background:#20212a;
border:1px solid #3f4150;
}
I changed max-width from 700px to 1500px and 80%, but nothing changes.
I've done a hard refresh on the browser (ctrlF5) but that doesn't help.
Any help would be appreciated! Thank you.
If i understood u , u want make modal more large thats right , add in ur HTMl div class="reveal creator-modal" width:100%
.creator-modal {
background: #20212a;
border: 1px solid #3f4150;
padding: 0;
max-width: 750px; /* up to 750px */
}
<div class="reveal creator-modal" id="fightgirls" data-reveal="" role="dialog" aria-hidden="false" data-yeti-box="fightgirls" data-resize="fightgirls" data-n="xyhm2h-n" style="display: block; top: 37px; width: 100%;" tabindex="-1">
<img src="assets/img/creators/fightgirls.jpg" alt="Frank Cho">
<button class="close-button" data-close="" aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>

Button with tag "input button" and "a" is not on the same line

I'm here again asking :)
I am needing to have 2 types of buttons, one using "input button" and another using the tag "a" link.
But when trying to do this, "button" using the tag "a" is lower than the others, and I'm not able to make it stay in the same line of the other buttons.
I put the example in jsFiddle:
http://jsfiddle.net/mtsys/RLgEj/
<br><br><br>
<input name="btnSubmit" class="botao salvar" type="submit" value="Salvar" />
<input name="btnSubmit" class="botao excluir" type="submit" value="Excluir" />
<input name="btnSubmit" class="botao voltar" type="submit" value="Voltar" />
<a class="botao voltar" href="/Produto/Index">Voltar </a>
tks
Try this
.botao {
vertical-align: middle;
}
a.botao {
padding-top: 7px;
height: 24px !important;
}
http://jsfiddle.net/RLgEj/6/
Put this:
<body style="line-height:30px;">
See DEMO
http://jsfiddle.net/RLgEj/5/
add this to your css (last rule):
.botao {
background-color:#fff;
border-radius:6px;
border:1px solid #87a5b6;
display:inline-block;
color:#000;
font-family:Verdana;
font-size:12px;
font-weight:bold;
padding-left:32px;
padding-right :16px;
text-decoration:none;
cursor:pointer;
height:32px;
line-height: 32px;/* this is the magic */
}
i updated the Fiddle

Side by side on every screen resolution

I have created a simple layout with Html and CSS which is like below :
CSS
.search-box{border:1px solid gray;padding:
5px;border-right:5px solid gray;padding-right:30px;
width:60%;font-size:14px;}
.search-box:focus{outline:none;}
.search-buton{background-color:gray;
border:1px solid gray;padding:5px;font-size:14px;
cursor:pointer;color:#fff;width:10%;}
.search-buton:hover{background-color:#575E5B;border:1px solid #575E5B;}
.left{float:left; border:1px solid gray; width:68%;padding:10px;}
.right{float:right; border:1px solid gray;width:28%;padding:10px;}
HTML
<div class="right">
<input class="search-box" type="text" placeholder="ASP.NET MVC, JQuery, Ajax, etc." />
<input class="search-buton" type="submit" value="Search" />
</div>
<div class="left">
</div>
<div style="clear:both;"></div>
See the JSFiddle sample :
http://jsfiddle.net/tugberk/uuVuW/
As you can see, I am unable to see them smoothly. Some screen resolutions, it is perfect. But when I zoom in inside the browser, it is where the things get messy.
I thought about fixing this with CSS3 media queries but I am sure there is some CSS trick which solve this problem for me. Any thoughts?
BTW, Any suggestion for the title of this question would be great. It is
not so creative I think.
You need to use percentages for the padding as well because this affects the overall width
Here's an example:
http://jsfiddle.net/uuVuW/2/
This explains the box model:
http://www.w3.org/TR/CSS2/box.html
you can write like this :
.left{
border:1px solid gray;
padding:10px;
overflow:hidden;
padding: 10px;
}
.right{
float:right;
border:1px solid gray;
width:28%;
padding:10px;
margin-left:20px
}
check this http://jsfiddle.net/sandeep/uuVuW/3/

a question about layouting a submit button

i have a layout problem.
i have this sample code:
<div class="frame"><div class="holder"><form class="newform">...<div class="button"><input type="submit"></div></form></div></div>
And this stylesheet:
form.newform{border:1px solid orange}
div.button{border:1px solid red;width:100%;position:relative;overflow:hidden;}
Now the submit button (red-box) will be displayed at the bottom of the form (orange-box). But i like to display it AFTER (eg. 10px after bottom line) the orange-box.
Maybe someone can help me to solve this problem.
Best regards
Tim
Edit:
This is the complete css part of form.newform
overflow:hidden;
height:1%;
background:url(../images/contentform.gif) repeat-y;
padding:0 0 2px;
border:1px solid orange;
i tried to add bottom:-10px; to the div.bottom but the submit button will be cut at the bottom line of the form. Adding a z-index:200 wont help.
One option would be to use CSS to specifically shift the position of the submit button. I've made up the below so it will probably look completely wrong, but play around with it.
HTML:
<input type="submit" id="submitbutton">
CSS:
#submitbutton {
position: relative;
bottom: -50px;
}
You cannot have a submit button outside the form element, it needs to be inside.
If you want two boxes, one orange and one red, with the orange one containing the form input fields and the red one containing the submit button, you should do something like this:
<div class="frame">
<form class="newform">
<div class="holder">
...
</div>
<div class="button">
<input type="submit">
</div>
</form>
</div>
And in your css
.holder { border:1px solid orange; }
.button { border:1px solid red; margin-top:10px; }

searchbox with jquery ui

I am trying to get my searchbox to look like that of facebook, where the button looks like it's inside the textbox. Please see the facebook home page.
I am using jquery ui and the graphics with it, for the button, problem is I think it adds borders to the button is creates, hence there is this separation between the text input and the button, anyway to get around this?
Here is my search form
<div class="div-search-form" style="display: inline; float: right;"><form method="get" id="search_form" class="" action="/searches">
<input type="text" value="Search" name="q" id="q" class="search-term" style="border: medium none;">
<span class="small-button"><a id="search_button" href="#" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" role="button" aria-disabled="false" title="Search"><span class="ui-button-icon-primary ui-icon ui-icon-search"></span><span class="ui-button-text">Search</span></a></span>
</form>
</div>
UPDATE
I think I am getting there.
Here is my css
.search-button {
background-position: -160px -112px;
display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat;
background-image: url(images/ui-icons_ff0084_256x240.png);
float:left;
border-left: 0 !important;
background-color: white;
width:16px;
}
.search-term {
padding:1px 5px 1px 20px;
border: 0 !important;
float:left;
background-image: url(images/ui-bg_flat_0_eeeeee_40x100.png);
}
.search-term:focus{
background-image: none;
}
.div-search-form {
margin-right: 0;
float:right;
margin-top:5px;
}
AND THE markup
<div class="div-search-form"><form method="get" id="search_form" class="" action="/searches">
<input type="text" value="Search" name="q" id="q" class="search-term">
<a class="search-button" id="search-button" href="#"> </a>
</form>
</div>
Notice that unless I put a &nbps; the background image of the anchor tag doesn't show up. wonder why?
Also, Not sure how to make them both the same size and bigger in height. Right now they are both 16px in height, but If I play with the padding the alignment goes out of whack.
Essentially what you need to do is create an image that mirrors the style of the input field on the left.
You will float the input field next to the button.
For the input field on the left control the CSS so there is not a right border, also make sure you add some padding, so that the text doesn't run into the button.
input.search-term { float:left; border:1px solid #CCCCCC; border-right:none; padding:5px; }
On your image do not have a left border
.smallbutton a { float:left; border:1px solid #CCCCCC; border-left:none; background:url(../imagepath); disiplay:block; height:XXpx; width:XXpx; }
The trick isn't as much about a technical way to do it, rather being creative with the images and CSS you use to accomplish the goal.

Resources