FED Test HTML & CSS
Recreate this image with HTML and CSS
by padma rubhan
HTML
<script src="//use.typekit.net/rzv2mwh.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Raleway" />
<div class="container">
<!--Your HTML goes here-->
<!--Make it responsive, ok to increase spacing etc. use your judgement -->
<!--Make the 'why give $50' a responsive modal with any content -->
<div class="main-box">
<div class="box arrow-bottom">
<span>$</span><span>6545</span> still needed for this project
</div>
<div id="myProgress">
<div id="myBar"></div>
</div>
<div class="content">
<p class="left-align">
<span class="txt-orange">Only 3 days left</span> to fund this project.
</p>
<p class="left-align">
Join the other 42 donors who have <br/>already supported this project. Every<br/> dolor helps
</p>
<div class="content-1">
<div class="child-1">
<input type="number" id="text" value="50" maxlength="8" oninput="myFunction()">
<i class="abs">$</i>
</div>
<div class="child-2">
<button class="btn">
Give Now
</button>
</div>
</div>
<p class="dyn">
<i>Why give $<span id="val">50</span> ?</i>
</p>
</div>
<div class="content-1">
<div class="child-1">
<button class="btn1">
Save for later
</button>
</div>
<div class="child-2">
<button class="btn1">
Tell yor friends
</button>
</div>
</div>
</div>
</div>
CSS
/* Global resets */
* {box-sizing: border-box; margin: 0; padding: 0;}
body {font-family: "rooney-sans", Avenir-Book, Calibri, sans-serif; color: #424242; line-height: 1.4;}
/* Fonts */
h1 {
font-family: "rooney-web", 'AmericanTypewriter', Rockwell, serif;
font-size: 2.5em;
font-weight: bold;
}
.container {
margin: 2em auto;
max-width: 630px;
text-align: center;
color: #828282
}
/* COLORS:
blue: #20A1D4;
green: #1CBC2C;
orange: #EF5F3C;
black: #424242;
grey: #777;
light grey: #eaeaea;
*/
/* Your CSS goes here */
.main-box{
padding: 20px;
width: 80%;
margin-left: auto;
margin-right: auto;
}
.box {
width: 100%;
background-color: #777;
color: #fff;
padding: 15px;
position: relative;
border-radius: 3px
}
.box.arrow-bottom:after {
content: " ";
position: absolute;
right: 30px;
bottom: -10px;
border-top: 10px solid #777;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
border-bottom: none;
}
span{
font-family: 'Raleway'
}
#myProgress {
margin-top: 10px;
width: 100%;
background-color: #ddd;
}
#myBar {
width: 70%;
height: 15px;
background-color: #EF5F3C;
}
.content{
border: 1px solid #ccc;
}
.left-align{
text-align: left;
padding: 15px 15px 15px 20px
}
.txt-orange{
color: #EF5F3C
}
.content-1{
display: inline-flex;
width:100%;
}
.abs{
position: absolute;
top: 33%;
left:12%;
font-size: 18px;
font-weight: bold;
}
#text{
padding: 15px 23px;
font-size: 18px;
font-weight: bold;
width: 100%;
}
.child-1{
position: relative;
width: 50%;
padding: 15px;
}
.child-2{
width:50%;
padding: 15px;
}
.btn{
width: 100%;
font-size: 26px;
color: #fff;
background-color: #1CBC2C;
border: 0px;
padding: 12px;
}
.dyn{
color: #20A1D4;
text-align: left;
padding: 5px 0 25px 15px;
}
.btn1{
width: 100%;
border: 0px;
padding: 10px 0px;
}
JavaScript
/*Add functionality*/
function myFunction() {
var x = document.getElementById("text").value;
document.getElementById("val").innerHTML = x;
}