Search
 
SCRIPT & CODE EXAMPLE
 

CSS

responsive css

/* Smartphones (portrait) */
@media only screen and (max-width: 320px) {
  /* Styles */
}

/* iPads (portrait and landscape)  */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  /* Styles */
}

/* Desktops and laptops  */
@media only screen and (min-width: 1224px) {
  /* Styles */
}
Comment

responsive width CSS

/* Instead of using px measurements, use % when setting width or height.*/
/* The % is calculted from the width of the parent element.*/
#NonResponsiveWidth {
	width: 1080px;
    height: auto;
}
#responsiveWidth {
	width: 85%;
    height: auto;
}
/*For text, use vw (viewport-width) instead of px when setting font-width*/
#NonResponsiveText { font-size: 20px; }
#responsiveWidth { font-size: 10vw; }
Comment

how to make responsive website using css

/* instead of using px for with and height use % */
/* % from the parent element fx. parent element has 100 px and the chiled 
element has 50% then it will be like it has 50px */
.NonResponsiveParent{
  width: 100px;
  height: 100px;
}

.responsiveChild{
  width: 50%; /* 50px */
  height: 50%; /* 50px */
}
/* now if you want it to work better on other screens then your own, 
the best way is using this with media querys.
media query is where you give your site a braiking point that says when you
get this amount of px the website will use this css
*/

/*example*/
body{
background-color: red;
}
/* this is the normal background color */

@media only screen and (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}
/* 
and this is the background color when the site with gets to 600px and under 
*/
Comment

responsive web design with html5 and css

// media queries example

	/* wide laptop */
@media screen and (max-width: 1200px) {
	.home-hero-image {
		height: 50vh;
	}
}

/* small laptop */
@media screen and (max-width: 900px) {
	.home-hero-image {
		height: 60vh;
	}
	.hero-text-home {
		margin-top: 25px;
	}
	.hero-school-home-image {
		width: 40%;
	}
}
Comment

how to create responsive website using css

#using media queries
#use rem, em ,% instead of px in CSS
Comment

CSS RESPONSIVE

div {
  font-size: min(3vw, 36px);
}
Comment

PREVIOUS NEXT
Code Example
Css :: how to make a game engine 
Css :: how to insert gradient in css 
Css :: remove or hide powered by text from Google Translate 
Css :: css math functions 
Css :: remove double quotes from string kotlin 
Css :: html disabled button hover style 
Css :: linux copy directory permissions to another directory 
Css :: css change text color 
Css :: flex grow 
Css :: set min div height 
Css :: centering using flexbox 
Css :: background center 
Css :: font shorthand 
Css :: scss select all childs 
Css :: does boxshadow work 
Css :: css how to make text italic 
Css :: css scroll height if screen too small 
Css :: remove horizontal scroll in small devices css 
Css :: DIVI Responsive menu breakpoints 
Css :: css transition on click 
Css :: angular css path to assets 
Css :: flex: 0 1 auto 
Css :: how to style the button 
Css :: transition behaviour in css 
Css :: for loop for increment id of div in jquery 
Css :: css forbidden cursor 
Css :: remove black border from border css 
Css :: code css for mozila 
Css :: background css image 
Css :: trim background image css 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =