mercredi 21 janvier 2015

Sketch image not responsive


so I created a background using Sketch, and added some buttons on top on that image. The problem is that image is not responsive with browser zoom, if I zoom in buttons will resize but not the image. Here is my html :



<div id='container'>
<%= image_tag('Group.jpg', class: 'image') %> <br/>
<%= button_to "Sign up", new_user_registration_path, :method => :get, class: 'signup'%><br/>
<%= button_to "Log in", new_user_session_path, class: 'signin', :method => :get %>
<%= button_to "Sign in with facebook", user_omniauth_authorize_path(:facebook), class: 'facebook' %><br/>
</div>


And here is the css :



// CSS reset
* {
margin: 0;
padding: 0;
}
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}

.image {
width:100%;
}

#container {
position :relative;
}
.signup, .signin {
cursor:pointer;
width :15%;
height:7%;
background: #EB6553;
border: 1px solid #979797;
border-radius: 5px;
/* Sign up : */
font-family: AmericanTypewriter;
font-size: 2em;
color: #000000;
}

.signup {
position:absolute;
top :58%;
left: 30%
}

.signin {
position:absolute;
top : 58%;
right: 30%;
}

.facebook {
position:absolute;
top: 85.5%;
left:40%;
cursor:pointer;
width: 22%;
height:5.5%;
background: #415E9B;
border: 1px solid #979797;
border-radius: 5px;
/* Sign in with faceboo: */
font-family: AmericanTypewriter;
font-size: 1.5em;
color: #FFFFFF;
}




Aucun commentaire:

Enregistrer un commentaire