I have created a site, where people can come and create their own quiz questions. Later, they will be able to see these questions.
html,
body,
div {
margin: 0;
padding: 0;
font-size: 1.2vw;
font-family: Arial, sans-serif;
}
a {
text-decoration: none;
color: inherit;
}
a:hover,
li:hover {
background-color: black;
color: white;
}
.action {
display: inline-block;
font: inherit;
font-size: 1.8vw;
padding: 0.5% 2% 0.5% 2%;
background-color: #ffffff;
text-align: center;
border-color: black;
border-style: solid solid solid solid;
border-radius: 0.5em 0.5em 0.5em 0.5em;
border-width: 0.15em;
margin: 2% 2% 0% 2%;
}
#content_question {
text-align: center;
position: fixed;
display: block;
left: 16%;
right: 34%;
width: 48%;
top: 15%;
bottom: 5%;
}
.question_fields {
display: inline-block;
padding: 2% 4% 2% 4%;
font: inherit;
color: white;
text-align: center;
background-color: black;
border-color: black;
border-style: solid solid solid solid;
border-radius: 0.5em 0.5em 0.5em 0.5em;
border-width: 0.15em;
font-size: 1.8vw;
resize: none;
outline: none;
}
#question {
width: 90.5%;
height: 21.2%;
}
.question_fields.answers {
display: inline;
width: 40.3%;
margin-top: 0.5%;
font-size: 1.5vw;
background-color: #ea5400;
color: black;
}
#right_answer {
background-color: #008000;
}
#source {
background-color: white;
width: 90.5%;
}
#create_question {
display: block;
margin: 1.5% auto 0% auto;
}
#create_question:hover {
background-color: black;
color: white;
}
.show_question_fields {
display: inline-block;
font: inherit;
text-align: center;
border-color: black;
border-style: solid solid solid solid;
border-radius: 0.4em 0.4em 0.4em 0.4em;
border-width: 0.15em;
font-size: 1.8vw;
}
#show_question {
color: white;
background-color: black;
width: 98.5%;
height: 26.2%;
border-radius: 0.5em 0.5em 0.5em 0.5em;
margin-bottom: 0.3%;
}
.show_question_fields.answers {
color: black;
background-color: #ea5400;
width: 47.8%;
height: 22.3%;
margin-top: 0.5%;
margin-bottom: 0.35%;
margin-right: 0.35%;
margin-left: 0.4%;
}
.show_question_fields.source {
color: black;
background-color: white;
width: 98.5%;
height: 13.6%;
margin-top: 0.5%;
margin-bottom: 0.4%;
}
#show_right_answer {
background-color: #008000;
}
HTML looks like that:
<div id="content_question">
<div id="show_question" class="show_question_fields">
<p>
Question
</p>
</div>
<div id="show_right_answer" class="show_question_fields answers">
<p>
Right Answer</br>
Right Answer Part 2
</p>
</div>
<div class="show_question_fields answers">
<p>
Answer 2
</p>
</div>
<div class="show_question_fields answers">
<p>
Answer 3
</p>
</div>
<div class="show_question_fields answers">
<p>
Answer 4
</p>
</div>
<div class="show_question_fields source">
<p>
Source
</p>
</div>
To Main Page
Back
</div>
As you can see, margin-bottom under an answer field is bigger, when the answer consists of two or more lines. That should not be the case.
Can anybody help me fix this issue? I already tried changing margin, line-height and padding, but it won't help.
Just add vertical-align: top to your "show_question_fields" class:
.show_question_fields {
display: inline-block;
font: inherit;
text-align: center;
border-color: black;
border-style: solid solid solid solid;
border-radius: 0.4em 0.4em 0.4em 0.4em;
border-width: 0.15em;
font-size: 1.8vw;
vertical-align: top;
}
Related
I'm making a short little iMessage code block, and I'd like to fill in the gap above the header with the same grey color, that conforms to the outer border rounding on the top only. (I'd also like to make the gap a little smaller, which I believe is done by changing the margin-top, it just cuts over the outer border behind it.
#workskin .phone {
max-width: 300px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
display: table;
margin: auto;
border: 1px solid;
border-radius: 25px;
border-color: #B5B5B5;
background-color: #FFFFFF;
max-height: auto;
}
#workskin .header {
min-width: 300px;
background-color: #f6f6f6;
border-bottom: 1px solid #b2b2b2;
color: #000000;
font-weight: bold;
padding-bottom: .5em;
margin-left: -.5em;
margin-top: .5em;
margin-right: -.5em;
margin-bottom: -2em;
text-align: center;
text-transform: capitalize;
display: block;
}
#workskin .messagebody {
background-color: #FFFFFF;
display: table;
padding-left: .5em;
padding-right: .5em;
}
#workskin .text {
float: left;
color: #000000;
margin: 0 0 0.5em;
border-radius: 1em;
padding: 0.5em 1em;
background: #e5e5ea;
max-width: 75%;
clear: both;
position: relative;
left: 1em;
}
#workskin .text::after {
content: "";
position: absolute;
left: -.5em;
bottom: 0;
width: 0.5em;
height: 1em;
border-right: 0.5em solid #e5e5ea;
border-bottom-right-radius: 1em 0.5em;
}
#workskin .breply {
float: right;
color: #FFFFFF;
margin: 0 0 0.5em;
border-radius: 1em;
padding: 0.5em 1em;
background: #1289fe;
max-width: 75%;
clear: both;
position: relative;
right: 1em;
}
#workskin .breply::after {
content: "";
position: absolute;
right: -0.5em;
bottom: 0;
width: 0.5em;
height: 1em;
border-left: 0.5em solid #1289fe;
border-bottom-left-radius: 1em 0.5em;
}
#workskin .time {
text-align: center;
padding: 0.5em 1em;
display: block;
}
#workskin .time::after {
content: "";
position: absolute;
right: -0.5em;
bottom: 0;
width: 0.5em;
height: 1em;
border-left: 0.5em solid #1289fe;
border-bottom-left-radius: 1em 0.5em;
}
<div class="phone">
<p class="messagebody"><span class="header">Alya 😘😘</span><br />
<br />
<span class="time">3:02PM</span><br />
<span class="text">Hey girl are your classes done yet</span><br />
<span class="breply">Just finished</span><br />
<span class="breply">Why?</span><br />
<span class="text">Wanna get lunch before you go home?</span><br />
<span class="breply">Sure. Let’s go to the campus cafeteria though</span><br />
<span class="breply">I have homework to work on already 🙄</span><br />
</p></div>
I tried editing the header itself, but it rounds the entire container, not just the top.
Rather than having to play with negative margins, it seemed easier to just simplify the layout and CSS, as follows:
<div id="workskin">
<div class="phone">
<div class="header">Alya 😘😘</div>
<div class="messagebody">
<div class="time">3:02PM</div>
<div class="text">Hey girl are your classes done yet</div>
<div class="breply">Just finished</div>
<div class="breply">Why?</div>
<div class="text">Wanna get lunch before you go home?</div>
<div class="breply">Sure. Let’s go to the campus cafeteria though</div>
<div class="breply">I have homework to work on already 🙄</div>
</div>
</div>
</div>
#workskin .phone {
max-width: 300px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
display: table;
margin: auto;
border: 1px solid;
border-radius: 25px;
border-color: #B5B5B5;
background: linear-gradient(to bottom, #F6F6F6 0% 37px, #FFFFFF 37px 100%);
max-height: auto;
padding-bottom: 1em;
}
#workskin .header {
min-width: 300px;
border-bottom: 1px solid #B2B2B2;
color: #000000;
font-weight: bold;
padding-top: 0.5em;
padding-bottom: 0.5em;
text-align: center;
text-transform: capitalize;
}
#workskin .messagebody {
display: table;
padding-left: 0.5em;
padding-right: 0.5em;
}
#workskin .time {
text-align: center;
padding: 0.5em 1em;
}
#workskin .text,
#workskin .breply {
margin: 0 0 0.5em;
border-radius: 1em;
padding: 0.5em 1em;
max-width: 75%;
clear: both;
position: relative;
}
#workskin .text {
float: left;
color: #000000;
background: #e5e5ea;
left: 1em;
}
#workskin .breply {
float: right;
color: #FFFFFF;
background: #1289fe;
right: 1em;
}
#workskin .text::after,
#workskin .breply::after {
content: "";
position: absolute;
bottom: 0;
width: 0.5em;
height: 1em;
}
#workskin .text::after {
left: -0.5em;
border-right: 0.5em solid #e5e5ea;
border-bottom-right-radius: 1em 0.5em;
}
#workskin .breply::after {
right: -0.5em;
border-left: 0.5em solid #1289fe;
border-bottom-left-radius: 1em 0.5em;
}
The background colour of the header is now actually coming from the .phone div using a linear gradient with stops instead of on the header element.
The challenge was that if you wanted the colour to just be on the .header element, you'd have to not round the .phone class on the top and use negative margins, which gets a tad messy.
Need to make two buttons align a few pixels left and right of the centre
I need div left to be 1px to the left of the centre. And right to be 1px right of it.
Any ideas how?
.btn {
font-family: helvetica;
font-weight: bolder;
padding: 10px;
border-radius: 2px;
color: black;
border: 2px solid black;
background-color: white;
width: 100px;
text-decoration: none;
}
.btn2 {
font-family: helvetica;
font-weight: bolder;
padding: 10px;
border-radius: 2px;
color: white;
border: 2px solid white;
background-color: black;
width: 100px;
text-decoration: none;
}
.divleft {
margin: auto 0;
text-align: left;
}
.divright {
margin: auto 0;
text-align: right;
}
<div class="divleft"> Memento </div>
<div class="divright"> Mori </div>
Use flexbox:
.box {
display: flex;
width: 100%;
}
.left,
.right {
width: 100%;
}
.left {
text-align: right;
margin-right: 10px;
}
a {
font-family: helvetica;
font-weight: bolder;
padding: 10px;
border-radius: 2px;
border: 2px solid black;
width: 100px;
text-decoration: none;
}
.btn {
color: black;
background-color: white;
}
.btn2 {
color: white;
background-color: black;
}
<div class="box">
<div class="left">
Memento
</div>
<div class="right">
Mori
</div>
</div>
Codepen: https://codepen.io/manaskhandelwal1/pen/jOMgpbd
I created a CodePen that shows how to make it work: https://codepen.io/kaireidcasey/pen/rNMXrde
The parent element needs display: flex set on it. The children each need an auto margin on one side. I am sure there are other ways to solve this, as well.
Code snippets:
HTML:
<div class="container">
<div class="divleft">
Memento
</div>
<div class="divright">
Mori
</div>
</div>
CSS:
.btn {
font-family: helvetica;
font-weight: bolder;
padding: 10px;
border-radius: 2px;
color: black;
border: 2px solid black;
background-color: white;
width: 100px;
text-decoration: none;
}
.btn2 {
font-family: helvetica;
font-weight: bolder;
padding: 10px;
border-radius: 2px;
color: white;
border: 2px solid white;
background-color: black;
width: 100px;
text-decoration: none;
}
.divleft {
margin-right: 1px;
margin-left: auto;
}
.divright {
margin-left: 1px;
margin-right: auto;
}
.container {
display: flex;
}
So im trying to have a button that has an arrow which aligns at the end of a box.
.profile-box {
border: 1px solid #2E2E2E;
border-radius: 0.5vw;
width: 15vw;
font-family: 'Open Sans', sans-serif;
padding: 2vw;
text-align: left;
margin: 1vw;
}
.box-title {
font-weight: bold;
margin-bottom: 1vw;
}
.box-btn {
border: none;
outline: none;
background-color: transparent;
font-size: 1vw;
}
.arrow {
border: solid black;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
<div class="profile-box">
<div class="box-title"> My orders </div>
<button class="box-btn">
View orders
<i class="arrow"></i>
</button>
The problem is that right now the arrow is aligned next to the text rather than to the right of the box. Any suggestions?
Use flexbox to space the text and icon. Also I changed your HTML to use semantic HTML. I changed your meaningless div to a meaningful h2 element, change this to whatever heading you need here.
.profile-box {
border: 1px solid #2E2E2E;
border-radius: 0.5vw;
width: 15vw;
font-family: 'Open Sans', sans-serif;
padding: 2vw;
text-align: left;
margin: 1vw;
}
.box-title {
font-weight: bold;
margin-bottom: 1vw;
}
.box-btn {
border: none;
outline: none;
background-color: transparent;
font-size: 1vw;
display: flex;
justify-content: space-between;
width: 100%;
}
.arrow {
border: solid black;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
<div class="profile-box">
<h2 class="box-title"> My orders </h2>
<button class="box-btn">
View orders
<i class="arrow"></i>
</button>
</div>
Could anybody help me and have a look at my HTML page, and explain to me if this is a correct semantic way to set-up a HTML page?
I need to learn to build a webpage with as less divs as possible, but you can use them if you want to style something specific right? like I used them in this context.
So are there any any flaws in my HTML code?
.main-club-bar-music-festival {
overflow: auto;
}
.main-club-bar-music-festival h3 {
margin: 0;
}
.img-club-air {
position: relative;
}
.img-club-air img {
width: 100%;
}
.img-club-air a:first-child {
position: absolute;
margin: 10px;
width: 60px;
right: 0;
bottom: 0;
z-index: 1;
}
.img-club-air h2 {
position: absolute;
bottom: 0;
font-size: 20px;
width: 100%;
padding: 10px;
color: white;
font-family: "LemonMilk"
}
#paragraph-p {
padding: 20px;
margin: 0;
}
.rent-a-bike {
width: 200px;
margin: 20px auto;
text-align: center;
background-color: #eb6c74;
}
.rent-a-bike p {
margin: 0;
padding: 10px;
color: white;
text-transform: capitalize;
transform: translateX(-5%);
overflow: hidden;
}
.rent-a-bike img {
margin-top: 10px;
margin-left: 5px;
height: 38px;
float: left;
}
.show-me-the-way {
width: 200px;
margin: 20px auto;
text-align: center;
background-color: #eb6c74;
}
.show-me-the-way p {
margin: 0;
padding: 10px;
color: white;
text-transform: capitalize;
}
.show-me-the-way img {
height: 38px;
float: left;
}
.info-block {
background-color: #eb6c74;
color: white;
padding: 10px 20px;
text-transform: uppercase;
font-family: "NeueHaasGrotesk Light";
}
.address-club {
overflow: auto;
margin-bottom: 16px;
}
.address-club p {
padding: 10px 20px 0 20px;
margin-bottom: 0;
}
.address-club img {
height: 40px;
margin-left: 10px;
float: left;
margin-right: 10px;
}
.address-club a {
line-height: 40PX;
display: block;
color: #3b3b3b;
text-decoration: underline;
}
.address-club a[target=_blank] {
padding-left: 20px;
color: #0000EE;
}
.padding-info-club {
padding: 20px;
}
.regular-info-left {
float: left;
width: 49.5%;
text-align: center;
color: white;
}
.regular-info-left p:nth-child(1) {
margin: 0;
}
.regular-info-left p:nth-child(2) {
margin: 2px 0;
}
.regular-info-left p:nth-child(3) {
margin: 2px 0;
}
.regular-info-left p {
background-color: #3b3b3b;
height: 50px;
line-height: 50px;
text-transform: uppercase;
}
.regular-info-right {
float: right;
width: 49.5%;
text-align: center;
color: white;
}
.regular-info-right p:nth-child(1) {
margin: 0;
}
.regular-info-right p:nth-child(2) {
margin: 2px 0;
}
.regular-info-right p:nth-child(3) {
margin: 2px 0;
}
.regular-info-right p {
background-color: #3b3b3b;
height: 50px;
line-height: 50px;
text-transform: uppercase;
}
#overflow-regular-info {
overflow: auto;
}
.info-feedback-on-page {
margin: 10px 0;
border-top: 1px solid #eb6c74;
border-bottom: 1px solid #eb6c74;
padding: 0px 0px 10px 20px;
}
.info-feedback-on-page button {
border-radius: 40%;
background-color: transparent;
margin-right: 10px;
}
#button-yes {
background-color: white;
border-radius: 28px;
border: 2px solid #44c767;
color: #44c767;
font-size: 15px;
padding: 10px 25px;
outline: 0;
}
#button-yes:active {
position: relative;
top: 2px;
outline: 0;
}
#button-no {
background-color: white;
border-radius: 28px;
border: 2px solid #e35656;
color: #e35656;
font-size: 15px;
padding: 10px 25px;
outline: 0;
}
#button-no:active {
position: relative;
top: 2px;
outline: 0;
}
<main class="main-club-bar-music-festival">
<div class="img-club-air">
<img src="img/favorite-icon-add.svg" alt="add to favourites">
<img src="img/club-panama.jpg" alt="Club Panama">
<h2>panama</h2>
</div>
<h3 class="info-block">regular info</h3>
<section id="overflow-regular-info">
<div class="regular-info-left">
<p>dancing</p>
<p>go out with mates</p>
<p>expensive</p>
</div>
<div class="regular-info-right">
<p>edm</p>
<p>locals/foreigners</p>
<p>groups</p>
</div>
</section>
<p id="paragraph-p">Panama chose a bit of a peculiar spot to open a nightclub. Located outside the city centre, Panama created a diversified nightclub. The nightclub holds a lot of parties varying from electronic tp 80's and 90s parties. Panama also houses HappyHappyJoyJoy, an asian shared dining restaurant</p>
<div class="rent-a-bike">
<a href="http://www.ov-fiets.nl/huurlocaties?locatie=amsterdam&POST_AUTOCOMPLETE=%2Fhuurlocaties.xml" target="_blank">
<img src="img/bicycle-icon.svg" alt="OV-Bicycle">
<p>rent ov-bike
<br>€ 3,85,-/24 hour</p>
</a>
</div>
<div class="show-me-the-way">
<a href="">
<img src="img/location-icon.svg" alt="your location to destination">
<p>show me the way</p>
</a>
</div>
<h3 class="info-block">average price for a drink</h3>
<p class="padding-info-club">- € 2,30,-</p>
<h3 class="info-block">entrance</h3>
<p class="padding-info-club">- € 5,00,-</p>
<h3 class="info-block">address</h3>
<div class="address-club">
<p>Panama
<br> Oostelijke Handelskade 4
</p>
www.panama.nl
020 311 86 86<img src="img/phone-icon.svg" alt="call-icon">
</div>
<h3 class="info-block">opening hours</h3>
<p class="padding-info-club">Fr - Su: 21:00 - 05:00pm</p>
<div class="info-feedback-on-page">
<p>Was this information usefull for you as an international student?</p>
<button id="button-yes">yes</button>
<button id="button-no">no</button>
</div>
</main>
I have this login form, which works and looks just fine in Chrome, IE11 and Edge but when try it out on Firefox, it looks completely different;
My labels are not the same width, so I have to re-adjust them. Also, my submit button doesn't seem to take on styles.
How can I make this work with Firefox as well?
My HTML:
<div class="loginheader">تسجيل الدخول</div>
<div class="loginform">
<form action="login.php" method="post" name="myform" id="myform">
<p>
<label for="loginform">اسم المستخدم</label>
<input type="text" name="username" id="login" value="mohammed.nasyia#gmail.com" placeholder="اسم المستخدم" />
</p>
<p>
<label for="loginform">كلمة المرور</label>
<input type="password" name="password" id="password" value="mohammed.nasyia#gmail.com" placeholder="كلمة المرور" />
</p>
<p >
<input type="submit" name="submit" value="تسجيل الدخول" class="button admin-login-button"/>
</p>
</form>
</div>
<div class="loginfooter">
تسجيل الدخول كممتØÙ†
</div>
</div>
CSS:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
float: rihgt;
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-right: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
You can also check the JSFiddle of the form.
I removed the floats (with a typo), set the margin to left on the .admin-login-button. I also added a media query for smaller screens.
https://jsfiddle.net/6p4v9hs6/7/
New CSS here:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
/* float: rihgt; */
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-left: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
#media screen and (max-width: 540px) {
input[type=text], input[type=password] {
width: 90%;
}
}
Seems to work in both Safari and Firefox.