Search
 
SCRIPT & CODE EXAMPLE
 

CSS

how to make website responsive with 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

PREVIOUS NEXT
Code Example
Typescript :: req.user typescript 
Typescript :: check all running ports ubuntu 
Typescript :: prettier not working with tsx 
Typescript :: add space between subplots matplotlib 
Typescript :: remove &nbsp from string in typescript 
Typescript :: running scripts is disabled on this system 
Typescript :: benefits eat halim plant leaves 
Typescript :: install typescript mac 
Typescript :: onkeydown react typescript 
Typescript :: if exists drop a temp table 
Typescript :: how to destroy all widgets in a frame 
Typescript :: dart check if string is contained in list of strings 
Typescript :: useref react typescript 
Typescript :: deno web server 
Typescript :: define a ref typescript 
Typescript :: angular get url parameter 
Typescript :: react-scripts 
Typescript :: ionic toast 
Typescript :: No safe area insets value available. Make sure you are rendering `<SafeAreaProvider` at the top of your app. 
Typescript :: adonis identify method 
Typescript :: adonis where has 
Typescript :: A Tree Diagram is a drawing with branches of all possible outcomes 
Typescript :: a function that prints all numbers from 0 - n Added together python 
Typescript :: how to run typescript in vscode 
Typescript :: remove all objects in R 
Typescript :: wordpress get post attachments url 
Typescript :: find value in array ts 
Typescript :: kali linux virtualbox freeze 
Typescript :: react native typescript 
Typescript :: ionic 3 open link external 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =