FIDDLE
As you can see that this is a button behind the image. I wanna remove that button. And use the images as button
.buttonup {
padding: 0px;
width: 25px;
cursor: pointer;
margin-right: 25px;
}
.buttondw {
width: 25px;
cursor: pointer;
margin-left: 25px;
}
#count {
display: inline-block;
border-radius: 0px;
background-color: #ff9933;
border: none;
color: #ffffff;
text-align: center;
font-size: 18px;
padding: 5px;
width: 50px;
margin-top: 0px;
}
<center>
<button class="buttonup" id="plus" style="vertical-align:middle"><span><img src="http://i.imgur.com/jWPUjR9.png"> </span> </button> <span id="count">0</span>
<button class="buttondw" id="minus" style="vertical-align:middle"><span><img src="http://i.imgur.com/Vu6tuf9.png"> </span> </button>
</center>
Use input type="image"
You will need to preventDefault() on the click event if you do not want to submit the page or the form it is in
.buttonup {
padding: 0px;
width: 25px;
cursor: pointer;
margin-right: 25px;
}
.buttondw {
width: 25px;
cursor: pointer;
margin-left: 25px;
}
#count {
display: inline-block;
border-radius: 0px;
background-color: #ff9933;
border: none;
color: #ffffff;
text-align: center;
font-size: 18px;
padding: 5px;
width: 50px;
margin-top: 0px;
}
<center>
<input type="image" class="buttonup" id="plus" style="vertical-align:middle" src="http://i.imgur.com/jWPUjR9.png" /> <span id="count">0</span>
<input type="image" class="buttondw" id="minus" style="vertical-align:middle" src="http://i.imgur.com/Vu6tuf9.png" />
</center>
you are very close actually, juste add the background:none and border:none on you class :
.buttonup {
padding: 0px;
width: 25px;
cursor: pointer;
margin-right: 25px;
background:none;
border:none;
}
change some css
.buttonup {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: 0 none;
cursor: pointer;
padding: 0;
width: 45px;
}
.buttondw {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: 0 none;
cursor: pointer;
padding: 0;
width: 45px;
}
https://fiddle.jshell.net/g6Lhurae/25/
Try this:
.buttonup {
padding: 0px;
text-align: center;
width: 50px;
cursor: pointer;
margin-right: 10px;
border:none;
background:none;
}
.buttondw {
width: 50px;
text-align: center;
cursor: pointer;
margin-left: 5px;
border:none;
background:none;
}
tip:don't use the center tag in your html; it's deprecated and not supported in html5. (I know this isn't the question but feel it should be pointed out).
So my css/html for you would be as follows (count css taken from mplungians post)
var counter = 0, // Try change this what ever you want
votePlus = counter + 1,
voteMinus = counter - 1;
function checkIfUserVoted() {
return localStorage.getItem("voted");
}
if (!localStorage.getItem("voted")) {
localStorage.setItem("voted", counter);
$("#count").text(counter);
}
$(".buttonup").click(function() {
var vote = checkIfUserVoted() != votePlus ? votePlus : counter;
localStorage.setItem("voted", vote);
$(this).next().text(vote);
});
$(".buttondw").on('click', function () {
var vote = checkIfUserVoted() != voteMinus ? voteMinus : counter;
localStorage.setItem("voted", vote);
$(this).prev().text(vote);
});
#buttons{margin-left: 35%; margin-right:35%;}
.buttonup {
padding: 0px;
width: 25px;
cursor: pointer;
margin-right: 25px;
}
.buttondw {
width: 25px;
cursor: pointer;
margin-left: 25px;
}
#count {
display: inline-block;
border-radius: 0px;
background-color: #ff9933;
border: none;
color: #ffffff;
text-align: center;
font-size: 18px;
padding: 5px;
width: 50px;
margin-top: 0px;
}
.buttondw {
width: 25px;
cursor: pointer;
margin-left: 25px;
}
#count {
display: inline-block;
border-radius: 0px;
background-color: #ff9933;
border: none;
color: #ffffff;
text-align: center;
font-size: 18px;
padding: 5px;
width: 50px;
margin-top: 0px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<div id="buttons">
<input type="image" class="buttonup" id="plus" style="vertical-align:middle" src="http://i.imgur.com/jWPUjR9.png" /> <span id="count">0</span>
<input type="image" class="buttondw" id="minus" style="vertical-align:middle" src="http://i.imgur.com/Vu6tuf9.png" />
</div>
Related
I'm trying fix the Log-In & registration form. When you click on "Register" on my menu, you can see that the labels are perfectly formatted in the form but the input box are offset. I tried to fix it with float:left but it didn't work out too well. If somebody could help me with that, that would be awesome.
var popup = document.getElementById('id01');
var popupreg = document.getElementById('id02');
window.onclick = function(event) {
if (event.target == popup) {
popup.style.display = "none";
}
if (event.target == popupreg) {
popupreg.style.display = "none";
}
}
body {
margin: 0 auto;
background: #fff;
}
div.container {
text-align: center;
box-sizing: border-box;
margin: 0 auto;
padding: 5px;
background-color: #000;
}
a.nounderline span {
color: #00B200;
}
.main-menu {
width: 200px;
margin: 0 auto;
right: 26px;
position: fixed;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
height: 35%;
}
.floating-sidebar li {
text-decoration: none;
outline: none;
line-height: 2em;
display: block;
border-radius: auto;
position: relative;
top: 10px;
-webkit-transition: none;
-o-transition: none;
transition: none;
}
.floating-sidebar li a {
background-color: #fff;
color: #444950;
display: block;
padding: 7px;
text-decoration: none;
font-family: Arial, sans-serif;
font-size: 18;
font-weight: bold;
border-radius: 9px;
}
.floating-sidebar li a:hover {
background-color: #eee;
color: #00B200;
}
.floating-sidebar li a.active {
background-color: #eee;
color: #00B200;
}
.floating-sidebar:hover li a.register-link {
color: #b5e7a0;
background: #fff;
}
.floating-sidebar li a.active:hover {
background-color: #00B200;
color: #fff;
}
.topnav input[type=text] {
float: left;
padding: 4.5px;
padding-left: 28px;
width: 305px;
border: 2px solid #00B200;
border-radius: 18px;
outline: inherit;
margin-top: 80px;
margin-left: 115px;
font-family: Arial, sans-serif;
font-weight: bold;
font-size: 18px;
direction: inherit;
}
input::placeholder {
color: #BEBEBE;
}
span.topnav {
right: 50px;
}
.sortby-box {
padding-top: 124px;
padding-left: 44;
margin: 0 auto;
position: fixed;
}
.select-opt {
padding: 4px;
width: 120px;
border-radius: 8px;
outline: none;
border: 1px solid #00B200;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.select-opt option {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.popup,
.popupreg {
display: none;
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.8);
/* Black w/ opacity */
padding-top: 60px;
}
.popup-content,
.popupreg-content {
float: left;
position: fixed;
background-color: rgb(245, 245, 245);
width: 600px;
height: 400px;
border-radius: 39px;
left: 666px;
top: 210px;
border: 2px solid rgb(109, 196, 109);
}
.popup,
.popupreg label {
font-family: Arial, Helvetica, sans-serif;
}
.popup [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popupreg [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popup input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popupreg input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popup [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popupreg [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popup .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.popupreg .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.cancel {
text-align: right;
position: relative;
cursor: pointer;
}
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
.username-section,
.reg-section {
padding: 32px;
margin-left: 75px;
margin-top: 20px;
}
span.psswrd {
float: right;
padding-top: 16px;
}
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<header>
<div class="container">
Hello
</div>
</header>
<main>
<aside>
</aside>
</main>
<sidebar>
<div class="main-menu">
<ul class="floating-sidebar">
<li>Log In</li>
<li>Register</li>
<li>About</li>
<li>Language</li>
</ul>
</div>
</sidebar>
<div class="sortby-box">
<select class="select-opt">
<option>Newest</option>
<option>Popularity</option>
<option>Recommended</option>
</select>
</div>
<div class="topnav">
<input style="position:relative;" type="text" name: "searchText" placeholder="Search here.." maxlength="18">
<span style="position:absolute; left: 126px; top: 119px;" class="fa fa-search icon"></span>
</div>
<div id="id01" class="popup">
<form class="popup-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="username-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Log In">
</div>
</form>
</div>
<div id="id02" class="popupreg">
<form class="popupreg-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="reg-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="usrname">Mail</label>
<input type="text" id="mail" name="mail" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Register">
</div>
</form>
</div>
<script src="index.js"></script>
<footer>
</footer>
A simple fix would be to give the label elements a display: inline-block; and give them a defined width such as width: 100px;.
I quickly created a JSFiddle to illustrate.
Hope this helped.
The problem is that the elements are not appearing next to each other as I want them to.
all three elements are already on float left and in the right order but they are still not lining up in the right way.
(so probably, the problem is that some elements are position:absolute or relative while they don't need to. The problem is: you can't change that without disrupting the drop-up menu of #Timer. That)
green_button {
background-color: #027fed;
color: white;
border-radius: 2px;
cursor: pointer;
float: right;
position: relative;
}
.green_button:active {
background-color: #eee;
color: black;
}
.keuze {
position: absolute;
width: 100px;
height: 100px;
float: left
}
#timer {
color: black;
background: #eee;
border: none;
padding-left: 10px;
font-size: 12px;
border-radius: 2px;
float: left;
padding: 12px 12px;
cursor: pointer;
list-style-type: none;
position: Relative;
margin-top: -14px;
width: 80px;
}
#timer:hover {
color: white;
background: #027fed;
}
li {
background-color: #eee;
font-size: inherit;
width: 150px;
position: relative;
float: left;
bottom: 31px;
left: 0;
display: block;
font-size: 12px;
text-decoration: none;
font-family: tahoma;
color: black;
width: 50px;
height: auto;
border: 1px solid #;
border-width: 1px 1px 0 0;
background: #eee;
background-color: rgb(238, 238, 238);
padding-left: 10px;
line-height: 38px;
border-radius: 2px;
height: auto;
line-height: 1em;
padding: 5px 10px;
width: 129px;
margin-bottom: 1px;
margin-left: 431px;
}
li:hover {
cursor: pointer;
background-color: #027fed;
color: white
}
.list {
display: none;
list-style-type: none;
position: absolute !important;
}
.keuze:hover .list {
display: block
}
.messages_compose {
padding: 10px;
margin-bottom: auto;
}
.messages_textarea_container {
display: inline-block;
width: 400px;
margin-left: 10px;
}
.messages_textarea {
border: 3px solid lightgray;
margin-top: 0;
margin-bottom: 10px;
padding: 5px;
width: 400px;
height: 40px;
resize: none;
float: left;
border-radius: 2px;
position: absolute;
}
.button {
border: none;
font-size: 12px;
padding: 12px 12px;
height: 40px text-align: center;
}
<div class="messages_compose">
<div class="vraag">CV</div>
<div class="messages_textarea_container">
<textarea class="messages_textarea"></textarea>
<button class="button green_button">Stuur</button>
<ul class="keuze">
<button id="timer">1 Jaar</button>
<div class="list">
<li id="jaar">jaar</li>
<li id="maand">maand</li>
<li id="week">week</li>
<li id="dag">dag</li>
</div>
</ul>
</div>
<script>
document.getElementById("jaar").onclick = function() {
jaar()
};
document.getElementById("maand").onclick = function() {
maand()
};
document.getElementById("week").onclick = function() {
week()
};
document.getElementById("dag").onclick = function() {
dag()
};
</script>
<script src="../scripten.js"></script>
</div>
If you want them side by side (if width allows), to make things simpler, make sure they are inline elements.
textarea and button are inline elements by default and unsorted-list are block element by default
Inline Elements
Block Elements
So basically, all you need is to change your ul to display: inline-block;
* {
padding: 0;
margin: 0;
vertical-align: text-top;
}
green_button {
background-color: #027fed;
color: white;
border-radius: 2px;
cursor: pointer;
}
.green_button:active {
background-color: #eee;
color: black;
}
.keuze {
display: inline-block; /* added */
width: 100px;
list-style: none;
}
.keuze li {
width: 100%;
}
#timer {
color: black;
background: #eee;
border: none;
padding-left: 10px;
font-size: 12px;
border-radius: 2px;
padding: 12px 12px;
cursor: pointer;
list-style-type: none;
width: 80px;
}
<div class="messages_compose">
<div class="vraag">CV</div>
<div class="messages_textarea_container">
<textarea class="messages_textarea"></textarea>
<button class="button green_button">Stuur</button>
<ul class="keuze">
<button id="timer">1 Jaar</button>
<div class="list">
<li id="jaar">jaar</li>
<li id="maand">maand</li>
<li id="week">week</li>
<li id="dag">dag</li>
</div>
</ul>
</div>
</div>
In addition, I have removed all your float and position from your css which I think as #Temani Afif says, you were just trying fix the issue by adding more to it.
I also have added followings just to make it tidier which is irrelevant to your issue. (That is to remove the default margin, padding and vertical align from all html elements to make it tidier and avoid unexpected behavior of different browsers)
* {
padding: 0;
margin: 0;
vertical-align: text-top;
}
I've used some html/scss to build a dropdown/select menu (I need to have full control of how the dropdown menu looks like).
The problem is that:
IE 11 opens the dropdown only when I click the down arrow instead the
whole text
in Safari 10.1.1 the dropdown doesn't hide after
clicking the menu "button" entry
Any help would be quite welcome (answering why it behaves like that would be awesome)
.onclick-menu {
position: relative;
display: inline-block;
padding: 0px;
margin: 0px 0px 1em 0px;
outline-width: 0px;
}
.onclick-menu:focus {
pointer-events: none;
}
.onclick-menu::before {
padding: 5px 10px 5px 10px;
background-color: black;
}
.onclick-menu__date-box {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 42px;
padding: 5px 10px 0px 10px;
border: 1px solid #d2d6d9;
position: relative;
min-width: 160px;
background-color: white;
border-radius: 5px;
}
.onclick-menu__date-box::after {
content: "";
transform: none;
background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDQ4IDQ4IiB3aWR0aD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjgzIDE2LjQybDkuMTcgOS4xNyA5LjE3LTkuMTcgMi44MyAyLjgzLTEyIDEyLTEyLTEyeiIvPjxwYXRoIGQ9Ik0wLS43NWg0OHY0OGgtNDh6IiBmaWxsPSJub25lIi8+PC9zdmc+");
background-size: cover;
display: inline-block;
position: relative;
right: -90%;
bottom: 33%;
z-index: 100;
min-width: 15px;
width: 15px;
max-width: 15px;
min-height: 11px;
height: 11px;
max-height: 11px;
}
.onclick-menu__label {
font-size: 14px;
line-height: 14px;
margin-bottom: 3px;
}
.onclick-menu-header {
color: #073590;
font-weight: bold;
}
.onclick-menu:focus .onclick-menu-content {
opacity: 1;
visibility: visible;
border: 1px solid #e5e7e8;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.12) 8px 8px 6px 0px;
width: -webkit-fill-available;
}
.onclick-menu-content {
pointer-events: auto;
position: absolute;
top: 38px;
left: -1px;
z-index: 1;
opacity: 0;
visibility: hidden;
transition-duration: 0.5s;
transition-property: visibility;
background-color: black;
width: auto;
border: 5px solid 1px black;
margin-top: 19px;
margin-left: 0px;
padding: 5px 15px 5px 5px;
}
.onclick-menu-content::after {
top: -9px;
border: 10px solid white;
}
.onclick-menu-content::before {
top: -10px;
border-bottom-width: 10px solid #e5e7e8;
}
.onclick-menu__date-selector {
border-style: none;
width: 100%;
z-index: 1000;
min-height: 16px;
-webkit-appearance: none;
background-color: white;
color: #073590;
font-size: 16px;
font-weight: bold;
outline-style: none;
}
.onclick-menu-content li {
list-style-type: none;
white-space: nowrap;
background-color: transparent;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
outline-width: 0px;
cursor: pointer;
padding: 5px 0px 5px 8px;
}
.onclick-menu-content li:hover {
background-color: #e8f4fd;
border-radius: 2px;
border-color: white;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0px;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"] {
-webkit-appearance: button;
cursor: pointer;
}
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
.onclick-menu-content button {
letter-spacing: 0.03em;
font-weight: bold;
display: block;
width: 100%;
background-color: transparent;
border-style: none;
color: inherit;
cursor: pointer;
outline-width: 0px;
text-align: left;
}
<div tabindex="0" class="onclick-menu__date-box onclick-menu">
<label for="date-select" class="onclick-menu__label">
Take your pick
</label>
<span class="onclick-menu-header">
foo1
</span>
<ul id="date-select" class="onclick-menu-content onclick-menu__date-selector">
<li value="foo1">
<button value="foo1">
foo1
</button>
</li>
<li value="foo2">
<button value="foo2">
foo2
</button>
</li>
<li value="foo3">
<button value="foo3">
foo3
</button>
</li>
</ul>
</div>
I wanted to know how to create fluid layout for this: I have form holder which is placed in middle of screen. Background of this holder is white, but on top left side is transparent triangle. I have created this in combination with SVG graphic and background property. I found this solution isn't the best and I have some problems with creating fluid layout for this. Please, look at code and suggest if you have some ideas.
Here is picture how it should look like.
HTML:
<body id="login">
<div class="container">
<h1>Login</h1>
<div class="red-line"></div>
<p class="email-sent">Your password reset email has been sent.</p>
<section class="login">
<div class="login-header">
<img src="assets/logo_menu_white.png" alt="" class="login-logo">
</div>
<div class="login-form-holder">
<input type="email" placeholder="Email address" class="input-login email-address">
<input type="passowrd" placeholder="Create password" class="input-login create-password">
FORGOT PASSWORD?<br>
<button class="btn-login">LOGIN</button>
</div>
</section>
<p class="new-customer">New customer? SIGN UP</p>
</div>
</body>
CSS
#login, #signup, #forgot-password {
background: url('../assets/main.png');
background-size: cover;
}
#login .container, #signup .container, #forgot-password .container {
text-align: center;
margin-top: 100px;
}
section.login, section.signup, section.forgot-password-section {
max-width: 490px;
min-height: 490px;
margin: 0 auto;
position: relative;
}
.login-header, .signup-header {
position: absolute;
width: 100%;
height: 200px;
top: 0;
left: 0;
background: url('../assets/login_bg.svg') no-repeat top center;
}
.login-form-holder, .signup-form-holder {
position: relative;
background: #fff;
padding-left: 50px;
padding-right: 50px;
top: 143px;
padding-bottom: 50px;
border-radius: 0px 0px 10px 10px;
}
section.login, section.forgot-password-section {
}
#login .login-logo, #signup .login-logo, #forgot-password .login-logo {
position: relative;
float: left;
margin-left: 30px;
margin-top: 40px;
z-index: 1000;
}
#login h1, #signup h1, #forgot-password h1 {
font-style: italic;
font-weight: 200;
font-size: 36px;
color: #fff;
}
#login .email-sent {
color: #c3c3c3;
margin-bottom: 35px;
margin-top: -10px;
display: none;
}
#login .red-line, #signup .red-line, #forgot-password .red-line {
width: 150px;
margin-top: 25px;
margin-bottom: 45px;
}
#login .new-customer, #signup .new-customer, #forgot-password .new-customer {
margin-top: 60px;
color: #fff;
}
.new-customer a {
color: #fff;
font-weight: 600;
padding-bottom: 5px;
border-bottom: 1px solid #ff204a;
}
.header a, .new-customer a:hover {
text-decoration: none;
border-bottom-color: #fff;
}
#login .input-login, #signup .input-login, #forgot-password .input-login {
margin: 0;
padding: 0;
background: none;
color: #b5b5b5;
border: none;
border-bottom: 2px solid #dbdbdb;
width: 100%;
text-indent: 45px;
padding: 25px 0px;
font-size: 16px;
}
#login .input-login:focus, #signup .input-login:focus, #forgot-password .input-login:focus {
outline: none;
}
#login .email-address, #signup .your-name, #signup .email-address, #forgot-password .email-address {
margin-bottom: 25px;
}
#login .email-address, #signup .email-address, #forgot-password .email-address {
background: url('../assets/email_address_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#login .create-password, #signup .create-password {
background: url('../assets/password_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#signup .your-name {
background: url('../assets/your_name_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#login .forgot-password, #signup .forgot-password {
text-align: right;
display: block;
margin-top: 20px;
font-size: 12px;
font-weight: 500;
color: #ff204a;
}
#login .forgot-password:hover, #signup .forgot-password:hover {
color: #de1c40;
text-decoration: none;
}
#signup .agree-terms {
font-size: 10px;
margin-top: 30px;
color: #5b5b5b;
}
.agree-terms a {
color: #ff204a;
padding-bottom: 2px;
border-bottom: 2px solid #ff204a;
font-weight: 500;
}
.agree-terms a:hover {
text-decoration: none;
}
#forgot-password .remark {
clear: both;
text-align: left;
margin-bottom: 40px;
line-height: 1.8;
}
EDIT: You can see the search box live here.
Before I explain, let me show you the code I am using:
HTML
<div class="SiteSearch">
<form action="/search" id="searchform" method="get">
<input x-webkit-speech="" autocomplete="off" type="text" id="gText" name="q" id="q" onblur="if (this.value == '') {this.value = 'Search';}" onfocus="if (this.value == 'Search') {this.value = '';}" value ='' "search" placeholder="Search.."/>
<input type="submit" id="gBtn"/>
</form>
</div>
CSS
#Head .SiteSearch {
top: 12px;
right: 0;
}
#Head .SiteSearch {
float: right;
position: relative;
}
input#gText {
float: left;
width: 225px;
height: 23px;
line-height: 24px;
text-indent: 5px;
font-family: arial,sans-serif;
font-size: 1em;
color: #333;
background: white;
border: solid 1px #D9D9D9;
border-top: solid 1px silver;
border-right: none;
vertical-align: middle;
-webkit-appearance: none;
-webkit-border-radius: 0px;
}
#searchform #gBtn {
background-image: url('search.png');
width: 31px;
height: 27px;
}
#gBtn {
vertical-align: middle;
cursor: pointer;
width: 40px;
height: 31px;
line-height: 100%;
padding: 0;
font-size: 0;
text-indent: -999px;
color: transparent;
background-position: 0 0;
border: none;
-webkit-appearance: none;
-webkit-border-radius: 0px;
}
input#gBtn:hover {
background-position: 31px 0;
border: none;
}
This is how the search box looks on IE7 vs. IE8/IE9:
vs.
As you can see above, the input button image isn't being shown in IE7. How can I fix this?
Any help is appreciated. Thanks!
I fixed it by modifying the CSS code like so:
#Head .SiteSearch {
top: 12px;
right: 0;
}
#Head .SiteSearch {
float: right;
position: relative;
}
input#gText {
float: left;
width: 225px;
height: 23px;
line-height: 24px;
text-indent: 5px;
font-family: arial,sans-serif;
font-size: 1em;
color: #333;
background: white;
border: solid 1px #D9D9D9;
border-top: solid 1px silver;
border-right: none;
vertical-align: middle;
-webkit-appearance: none;
-webkit-border-radius: 0px;
}
/* REMOVED THIS PIECE
#searchform #gBtn {
background-image: url('search.png');
width: 31px;
height: 27px;
}*/
#gBtn {
vertical-align: middle;
cursor: pointer;
width: 40px;
height: 31px;
line-height: 100%;
padding: 0;
font-size: 0;
text-indent: -999px;
color: transparent;
background-image: url('search.png'); /* ADDED */
background-position: 0 0;
border: none;
-webkit-appearance: none;
-webkit-border-radius: 0px;
}
input#gBtn:hover {
background-image: url('search.png'); /* ADDED - BUT OPTIONAL */
background-position: 31px 0;
border: none;
}
Write background instead of background-image in your #gBtn button. May be that's work