How to make responsive this code - css

my problem is this code that does not work when I make it responsive.. I know to change height and width must transform in percentage but this code is damaged when I make it responsive ..
This code *Css ( which I want to transform it into responsive ) :
#import url(http://weloveiconfonts.com/api/?family=entypo);
/* entypo */
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}
.entry{
width:430px;
position: RELATIVE;
top:600PX;
LEFT: 5PX;
margin:50px auto;
border-radius:50%;
float:left;
}
.container{
width:110px;
height:110px;
margin:0 0 30px 10px;
position:relative;
border-radius:60px;
background:rgba(255,255,255,.2);
box-shadow:3px 3px 5px rgba(0,0,0,.2);
transition:all .5s;
overflow:hidden;
}
.photo{
width:90px;
height:90px;
margin:8px;
border-radius:50%;
position:absolute;
left:0px;
overflow:hidden;
border:2px solid white;
}
.pic{ max-width:100%; }
.button{
width:60px;
height:60px;
position:absolute;
right:20px;
top:25px;
font-size:40px;
text-align:center;
line-height:60px;
border-radius:50%;
color:rgba(255,255,255,.8);
background:green;
background:linear-gradient(bottom,#5ca321,#8ab24f);
box-shadow:0 0 0 1px rgba(0,0,0,.2),
0 0 0 5px rgba(255,255,255,.1),
0 0 0 6px rgba(0,0,0,.2);
transition:all .5s;
cursor:pointer;
}
.button:hover{
background:#5ca321;
box-shadow:inset 0 1px 5px rgba(0,0,0,.3);
text-shadow:0px 0px 5px gray;
}
.name{
height:60%;
width:180px;
position:absolute;
right:80px;
padding:20px;
font:25px arial;
color:white;
opacity:0;
transition:all .5s .5s;
text-shadow:0 0 5px rgba(0,0,0,.5);
}
.small{ font-size:14px; display:block; margin-top:10px; }
.comment{
width:370px;
position:relative;
padding:15px;
font-size:16px;
color:rgba(0,0,0,.7);
border-radius:10px;
background:rgba(255,255,255,.4);
box-shadow:3px 3px 5px rgba(0,0,0,.2);
opacity:0;
transition:all 1s;
}
.comment:before{
content:'';
width:0;
height:0;
position:absolute;
bottom:100%;
left:2%;
border-bottom:15px solid rgba(255,255,255,.4);
border-left:50px solid transparent;
border-right:50px solid transparent;
border-top:15px solid transparent;
}
.container:hover{ width:400px; }
.container:hover .name,.container:hover + .comment{
opacity:1;
}
Maybe you need look demo
https://codepen.io/GARDFIELD3/pen/zNgmMP
I want to do this responsive that size and position Thank and ignore my mistakes of speech but i I do not speak English :)

It's not responsive because you don't have media queries in your CSS. As of right now, your code will run regardless of screen size, but let's say you wanted to look differently on a mobile phone, then you would do something like this:
#media screen and (max-width: 420px) {
/* put in different CSS code here */
}

You need to use media queries and target whichever element you want to change.
For example:
#media screen and (min-width: 767px) {
.entry {
margin-top: 100px;
}
}
This will add a margin-top of 100px to your .entry class for screens with a width equal to or bigger than 767px.
Read more/take a tutorial as an introduction.

Is this closer to what you want to achieve?
I've set the width of comment and entry to 100% because you probably want both div-tags to expand to the full width of the document.
Though it's true that the width will be relative to the document, this doesn't mean that any of this is responsive design. Responsive design keeps the viewport in regard. Try googling that. It's highly unlikely that there are no tutorials available in your language.
#import url(http://weloveiconfonts.com/api/?family=entypo);
#media screen and (max-width: 420px) {
/* entypo */}
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}
.entry{
width:100%;
position: RELATIVE;
top:60PX;
LEFT: 5PX;
margin:50px auto;
border-radius:50%;
float:left;
}
.container{
position:relative;
width:110px;
height:110px;
margin:0 0 30px 10px;
border-radius:60px;
background:rgba(255,255,255,.2);
box-shadow:3px 3px 5px rgba(0,0,0,.2);
transition:all .5s;
overflow:hidden;
}
.photo{
width:90px;
height:90px;
margin:8px;
border-radius:50%;
position:absolute;
left:0px;
overflow:hidden;
border:2px solid white;
}
.pic{ max-width:100%; }
.button{
width:60px;
height:60px;
position:absolute;
right:20px;
top:25px;
font-size:40px;
text-align:center;
line-height:60px;
border-radius:50%;
color:rgba(255,255,255,.8);
background:green;
background:linear-gradient(bottom,#5ca321,#8ab24f);
box-shadow:0 0 0 1px rgba(0,0,0,.2),
0 0 0 5px rgba(255,255,255,.1),
0 0 0 6px rgba(0,0,0,.2);
transition:all .5s;
cursor:pointer;
}
.button:hover{
background:#5ca321;
box-shadow:inset 0 1px 5px rgba(0,0,0,.3);
text-shadow:0px 0px 5px gray;
}
.name{
height:60%;
width:180px;
position:absolute;
right:80px;
padding:20px;
font:25px arial;
color:white;
opacity:0;
transition:all .5s .5s;
text-shadow:0 0 5px rgba(0,0,0,.5);
}
.small{ font-size:14px; display:block; margin-top:10px; }
.comment{
width:100%;
position:relative;
padding:15px;
font-size:16px;
color:rgba(0,0,0,.7);
border-radius:10px;
background:rgba(255,255,255,.4);
box-shadow:3px 3px 5px rgba(0,0,0,.2);
opacity:0;
transition:all 1s;
}
.comment:before{
content:'';
width:0;
height:0;
position:absolute;
bottom:100%;
left:2%;
border-bottom:15px solid rgba(255,255,255,.4);
border-left:50px solid transparent;
border-right:50px solid transparent;
border-top:15px solid transparent;
}
.container:hover{ width:100%; }
.container:hover .name,.container:hover + .comment{
opacity:1;
}
<div class="entry">
<div class="container">
<div class="button entypo-chat"></div>
<div class="name">CoStY
<span class="small">Fondator</span>
</div>
<div class="photo">
<img src="https://s12.postimg.org/pptidy8kd/14021445_1166695373388266_6290547632102759142_n.jpg" alt="" class="pic">
</div>
</div>
<p class="comment">Salut, numele meu este Enache Constantin si sunt creatorul acestei comunitati :) Puteti sa ajutati la intretinerea comunitatii printr-o donatie ,pm pentru detalii :) </p>
</div>
<div class="entry">
<div class="container">
<div class="button entypo-chat"></div>
<div class="name">Gardfield<3
<span class="small">Administrator</span>
</div>
<div class="photo">
<img src="http://farm1.staticflickr.com/133/378977890_40f31e1962_q.jpg" alt="" class="pic">
</div>
</div>
<p class="comment">Salut,numele meu este Alexandru Mihai iar misiunea mea este sa dezvolt aceasta comunitate din toate punctele de vedere. Sunt deschis la orice colaborare si ma puteti contacta pentru probleme tehnice printr-un pm :) </p>
</div>

Related

Why overflow:hidden is not working?

Overflow:hidden is not working for me. Gray box remains under the picture. I don't know whats wrong with it. I used this code from youtube tutorial.
If some one can help me, I will be very thankful.
.main
{
border: 10px solid white;
width:378;
height:250;
margin:50px auto;
box-shadow:0px 0px 25px black;
overflow:hidden;
}
.main:hover img
{
-webkit-transform:scale(2,2) rotate(45deg);
}
.main:hover .content
{
-webkit-transform:translate(-383px);
}
img
{
-webkit-transition: -webkit-transform: 300ms;
}
.content
{
width:378;
height:250;
background: rgba(118,115,115,0.5);
-webkit-transition: -webkit-transform: 300ms;
}
button
{
width:100%;
height:50px;
margin-top:200px;
background:black;
border:0;
cursor:pointer;
color:white;
font:16px tahoma;
}
button:hover {
opacity: 0.5;
}
<div class="main"><img src="img/switch.jpg" height="250" width="378"><div class="content"><button>Pepe Kalvier Switches</button></div></div>
You have to add values in px or in %, In your code you didn't declare a unit of measure i.e, whether you want to add px or % or em.
Demo
like this:
.main {
width:378px;
height:250px;
}
Add height and width with px in .main div
.main
{
border: 10px solid white;
width:378px;
height:250px;
margin:50px auto;
box-shadow:0px 0px 25px black;
overflow:hidden;
}
.main:hover img
{
-webkit-transform:scale(2,2) rotate(45deg);
}
.main:hover .content
{
-webkit-transform:translate(-383px);
}
img
{
-webkit-transition: -webkit-transform: 300ms;
}
.content
{
width:378;
height:250;
background: rgba(118,115,115,0.5);
-webkit-transition: -webkit-transform: 300ms;
}
button
{
width:100%;
height:50px;
margin-top:200px;
background:black;
border:0;
cursor:pointer;
color:white;
font:16px tahoma;
}
button:hover {
opacity: 0.5;
}
<div class="main"><img src="img/switch.jpg" height="250" width="378"><div class="content"><button>Pepe Kalvier Switches</button></div></div>
width:378;
height:250;
add px, pls
Just correct your css like this...
Your CSS
.main {
border: 10px solid white;
width:378;/* Your mistake is here */
height:250;/* Your mistake is here */
margin:50px auto;
box-shadow:0px 0px 25px black;
overflow:hidden;
}
Updated CSS
.main {
border: 10px solid white;
width:378px;
height:250px;
margin:50px auto;
box-shadow:0px 0px 25px black;
overflow:hidden;
}

CSS height adjusting

In my html i have somewhat like this
<div id="content">
<div id="wrapper">
<div id="steps">
<form id="formElem" name="formElem" action="" method="post">
<fieldset class="step">
<legend>General Information </legend>
</fieldset>
<fieldset class="step">
<legend>Medical History</legend>
</fieldset>
</form>
</div>
<div id="navigation" style="display:none;">
<ul>
<li class="selected">
General Information
</li>
<li>
Medical History
</li>
</div>
</div>
my css file is this
#content{
margin:30px auto;
text-align:center;
width:900px;
position: relative;
height:100%;
}
#left{
position: absolute;
z-index: 1;
margin-top:10px;
margin-left:30px;
text-align:center;
width:170px;
color:#000000;
height:500px;
-moz-box-shadow:0px 0px 13px #aaa;
-webkit-box-shadow:0px 0px 13px #aaa;
box-shadow:0px 0px 23px #aaa;
background-color:rgba(300,250,250,0.5);
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
}
#wrapper{
-moz-box-shadow:0px 0px 13px #aaa;
-webkit-box-shadow:0px 0px 13px #aaa;
box-shadow:0px 0px 23px #aaa;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
border:2px solid #fff;
//background-color:#f9f9f9;
background-color:rgba(220,220,220,0.5);
width:1000px;
height:100%;
overflow:hidden;
}
#steps{
width:1000px;
height:520px;
overflow: auto;
/* overflow: scroll;
overflow: */
}
.step{
float:left;
width:1000px;
/* height:600px; */
overflow-y: auto;
/* overflow:-moz-scrollbars-vertical; */
/*height:320px;*/
}
#navigation{
height:40px;
background-color:#e9e9e9;
border-top:1px solid #fff;
-moz-border-radius:0px 0px 10px 10px;
-webkit-border-bottom-left-radius:10px;
-webkit-border-bottom-right-radius:10px;
border-bottom-left-radius:10px;
border-bottom-right-radius:10px;
}
#navigation ul{
list-style:none;
float:left;
margin-left:10px;
}
#navigation ul li{
float:left;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
position:relative;
margin:0px 2px;
}
#navigation ul li a{
font-size: 10px;
display:block;
height:40px;
background-color:#444;
color:#777;
outline:none;
font-weight:bold;
text-decoration:none;
line-height:40px;
width: auto;
padding:0px 5px;
border-right:1px solid #fff;
border-left:1px solid #fff;
background:#f0f0f0;
background:
-webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.09, rgb(240,240,240)),
color-stop(0.55, rgb(227,227,227)),
color-stop(0.78, rgb(240,240,240))
);
background:
-moz-linear-gradient(
center bottom,
rgb(240,240,240) 9%,
rgb(227,227,227) 55%,
rgb(240,240,240) 78%
)
}
I want to adjust my height of every fieldset according to the length of fields present in it. how can i do this?
Fieldsets automatically adjust in height to contain the form elements contained within. No additional CSS is required.
The fieldsets must contain form fields obviously; not 100% sure why you've omitted them from your example code.

Why doesn't Chrome render this page as smooth as IE?

When I hover the first div for example, it is meant to change the bg color, and the color changes but it flashes when changing the color and it's not smooth at all in Chrome. but it is really smooth in IE and Firefox ... Why is that? (that's all I want to know)
CSS:
.bg {
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
width:100%;
height:100%;
background-color:#D8D8D8;
z-index:-10;
}
.DIVOne {
color:#FFF;
margin-top:10%;
background-color:#A2D700;
height:300%;
line-height:200%;
width:20%;
padding:0 20px;
font-size:300%;
font-family:Verdana, Geneva, sans-serif;
margin-left:20%;
border: solid 5px #000;
border-width:0 4px 5px 0;
border-radius:5px;
border-color:transparent #ddd #999 transparent;
background-clip:padding-box;
text-align:center;
z-index:-5;
}
.DIVOne:hover {
border-width:0 2px 3px 0;
margin-right:4px;
position:relative;
left:2px;
top:3px;
}
.DIVOne:hover ~ .bg {
background-color:#A2D700;
transition:all 0.5s;
}
.DIVTwo {
color:#FFF;
background-color:#FF8000;
height:300%;
line-height:200%;
width:20%;
margin-top:10px;
padding:0 20px;
font-size:300%;
font-family:Verdana, Geneva, sans-serif;
margin-left:20%;
border: solid 5px #000;
border-width:0 4px 5px 0;
border-radius:5px;
border-color:transparent #ddd #999 transparent;
background-clip:padding-box;
text-align:center;
z-index:-6;
}
.DIVTwo:hover {
border-width:0 2px 3px 0;
margin-right:4px;
position:relative;
left:2px;
top:3px;
}
.DIVTwo:hover ~ .bg {
background-color:#FF8000;
}
.DIVThree {
color:#FFF;
background-color:#0080FF;
height:300%;
line-height:200%;
width:20%;
margin-top:10px;
padding:0 20px;
font-size:300%;
font-family:Verdana, Geneva, sans-serif;
margin-left:20%;
border: solid 5px #000;
border-width:0 4px 5px 0;
border-radius:5px;
border-color:transparent #ddd #999 transparent;
background-clip:padding-box;
text-align:center;
z-index:-6;
}
.DIVThree:hover {
border-width:0 2px 3px 0;
margin-right:4px;
position:relative;
left:2px;
top:3px;
}
.DIVThree:hover ~ .bg {
background-color:#0080FF;
}
HTML:
<div class="DIVOne"> Content </div>
<div class="DIVTwo"> Content </div>
<div class="DIVThree"> Content </div>
demo: http://www.jsfiddle.net/aryanf/w7unZ/
The problem is with the following code
.DIVOne:hover {
border-width:0 2px 3px 0;
margin-right:4px;
position:relative;
left:2px;
top:3px;
}
It's the position:relative; property that is causing the problem on Chrome. Try removing it. Besides, I don't see why you have introduced it in the first place. It seems to work fine without it.
.DIVOne:hover {
border-width:0 2px 3px 0;
margin-right:4px;
//position:relative;
left:2px;
top:3px;
}
If it is not rendering and appearing smooth on other browsers, try to add some css code additionaly inside your CSS file.
Suppose if you need Rounded Corner Border in IE, you will use
.ddlStyle {
border-radius: 4px;
height: 22px;
width: auto;
max-width: 300px;
min-width: 120px;
padding: 0 0 0px 0px;
padding-right: 4px;
font-family: Calibri,Verdana, Tahoma, 'Segoe UI';
}
But this may not render perfect on all other Browser due to different behavior of Rendering Engine. So make addition of some lines and try on other browsers.
.ddlStyle {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
height: 22px;
width: auto;
max-width: 300px;
min-width: 120px;
padding: 0 0 0px 0px;
padding-right: 4px;
font-family: Calibri,Verdana, Tahoma, 'Segoe UI';
}
Hope, it solves the problem.

Blank whitespace only in firefox

firefox:
chrome:
does anyone know why this is happening in Firefox? it's driving me nuts
here is the css:
#gallery_grid .gallery_grid_item,#related_topics .gallery_grid_item,#popular_galleries .gallery_grid_item {
position:relative;
overflow:hidden;
display:block;
text-decoration:none;
}
#gallery_grid .gallery_grid_item {
width:288px;
height:260px;
box-shadow:0 1px 3px rgba(34,25,25,0.4);
-webkit-box-shadow:0 1px 3px rgba(34,25,25,0.4);
-moz-box-shadow:0 1px 3px rgba(34,25,25,0.4);
transition:margin .1s;
-moz-transition:margin .1s;
-webkit-transition:margin .1s;
-o-transition:margin .1s;
margin:15px;
}
#gallery_grid .gallery_grid_item:hover {
margin:13px 15px 17px;
}
#gallery_grid .gallery_grid_image_wrapper {
width:100%;
height:190px;
overflow:hidden;
}
#gallery_grid .gallery_grid_image {
min-height:100%;
}
#popular_galleries .gallery_grid_item,#gallery_grid .gallery_grid_item {
border:1px solid #999;
}
#related_topics .gallery_grid_item {
border:0!important;
width:242px;
height:140px;
overflow:hidden;
background:#181818;
margin:0;
}
#popular_galleries .gallery_grid_item {
width:200px;
height:140px;
letter-spacing:-.05em;
background:#181818;
margin:0 0 15px;
}
#popular_galleries.upsell .gallery_grid_item {
height:200px;
}
#related_topics .gallery_grid_item:nth-child(even) {
border:1px solid #777!important;
border-width:0 1px;
}
#gallery_grid .gallery_grid_item:hover,#related_topics .gallery_grid_item:hover,#popular_galleries .gallery_grid_item:hover {
border:1px solid #86d3ff;
}
#gallery_grid .gallery_grid_image,#related_topics .gallery_grid_image,#popular_galleries .gallery_grid_image,#related_topics .gallery_list_image {
width:100%;
overflow:hidden;
opacity:.9;
filter:alpha(opacity=90);
transition:opacity .1s;
-moz-transition:opacity .1s;
-webkit-transition:opacity .1s;
-o-transition:opacity .1s;
text-align:center;
display:block;
margin:0 auto;
}
#gallery_grid .gallery_grid_item:hover .gallery_grid_image,#related_topics .gallery_grid_item:hover .gallery_grid_image,#popular_galleries .gallery_grid_item:hover .gallery_grid_image,#related_topics .gallery_list_item:hover .gallery_list_image {
opacity:1;
filter:alpha(opacity=100);
}
#popular_galleries .gallery_grid_info,#related_topics .gallery_grid_info {
width:100%;
position:absolute;
bottom:0;
font-weight:500;
}
#gallery_grid .gallery_grid_info {
height:62px;
}
#related_topics .gallery_grid_info {
height:54px;
}
#popular_galleries .gallery_grid_info {
height:58px;
}
#related_topics.grid .gallery_title,#popular_galleries .gallery_title {
color:#fff;
text-shadow:1px 0 1px #000;
font-size:15px;
line-height:18px;
}
#gallery_grid .gallery_title {
font-size:16px;
line-height:21px;
color:#000;
text-shadow:none;
font-weight:600;
border-top:2px solid #00a3ff;
padding:10px 15px 0;
}
#gallery_grid .gallery_title:hover {
text-decoration:underline;
}
#popular_galleries .gallery_title {
height:39px;
overflow:hidden;
}
.trans_bg {
width:100%;
height:100%;
background:#000;
opacity:.5;
filter:alpha(opacity=50);
}
.content_over_transparent {
position:absolute;
top:0;
width:100%;
height:100%;
overflow:auto;
box-sizing:border-box;
-moz-box-sizing:border-box;
}
#gallery_grid .content_over_transparent,#related_topics .content_over_transparent {
padding:10px 15px 0;
}
#popular_galleries .content_over_transparent {
padding:10px 10px 0;
}
It's "content_over_transparent". Appreciate any help, thanks!
Edit:
Here is the grid item HTML (adding more content as it saying it's mostly code):
<a class="gallery_grid_item" href="#">
<img class="gallery_grid_image" src="http://d1qfo1bk8s78mq.cloudfront.net/uimg/5f9aa039ecf554f73312d912e22c516e.x355" />
<div class="gallery_grid_info">
<div class="trans_bg"></div>
<div class="content_over_transparent">
<p class="gallery_title">Finding your Perfect Red</p>
</div>
</div>
</a>
Add overflow: hidden; in .content_over_transparent, and it displays well both on FF and Chrome :
.content_over_transparent {
position:absolute;
top:0;
width:100%;
height:100%;
overflow:auto; /* Delete that */
box-sizing:border-box;
-moz-box-sizing:border-box;
overflow: hidden; /* Add that */
}
By the way, in your question you forgot to wrap your HTML code in a #popular_galleries.
Here's the fiddle : Fiddle

How to create speech-bubble border with CSS3

I want to create a stylized border with CSS3 like the below image. But, I don't know how? Here is the image:
Like this: http://nicolasgallagher.com/pure-css-speech-bubbles/
.triangle-isosceles {
position:relative;
padding:15px;
margin:1em 0 3em;
color:#000;
background:#f3961c;
/* css3 */
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
background:-moz-linear-gradient(top, #f9d835, #f3961c);
background:linear-gradient(top, #f9d835, #f3961c);
}
/* creates triangle */
.triangle-isosceles:after {
content:"";
display:block; /* reduce the damage in FF3.0 */
position:absolute;
bottom:-15px;
left:50px;
width:0;
border-width:15px 15px 0;
border-style:solid;
border-color:#f3961c transparent;
}
<style type="text/css">
.comments .comment{
width:10%;
margin-bottom:20px;
}
.comments .comment p{
margin:0 0 10px 0;
}
.bubble{
position:relative;
background-color:#CCC;
padding:20px;
color:#009;
border-radius:3px;
margin-left:20px;
}
.bubble::after{
content:"";
display:block;
position:absolute;
left:-15px;
top:15px;
width:0px;
height:0px;
border-top:8px solid transparent;
border-bottom:8px solid transparent;
border-right:15px solid #CCC;
}
</style>
<div class="comments">
<div class="comment bubble">
<p>This is comment</p>
</div>
</div>
you can use CSS3 box_round:
.box_round {
-webkit-border-radius: 5px;
border-radius: 5px;
}
try this site :)

Resources