Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Relative Werte CSS
/*RESET*/
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.beispiel1{
height: 2em;
/*für relative Breite % Angabe verwenden*/
width: 60%;
margin-left: 20%;
margin-top: 2vh; /*höhe des Viewport*/
margin-bottom: 4vh; /*höhe des Viewport*/
background-color: green;
}
.beispiel2{
height: 1em;
width: 100%;
background-color: blue;
}
.beispiel3{
height: 20em;
width: 80%;
margin-left: 10%;
background-color: red;
}
.relativeimg{
width: 50%;
/* alternativ zum Bsp. width: 50vw; vw = viewport-Breite*/
}
/*für relative Größe in Schriften vw Angabe verwenden*/
h1{
font-size:5vw;
}
p{
font-size:3vw;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.