I am designing a web page for the mobile first time. I have given 100% width and height so that content will render at the full page regardless of mobile screen size. but still, as you can see from the screenshot, there is empty space below and on the right side. Also even one of my checkbox content is even crossing the width of the page. I have tried putting that content in a span tag and defining a class and putting something like max-width: 20 px or something but it is not having any effect whatsoever. below my code snippet of HTML and css
/* style.css */
/* You can add global styles to this file, and also import other style files */
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
body {
margin: 0;
height: 100%;
width: 100%;
}
/* this page css */
mat-card{
width: 100%;
}
img{
padding: 2%;
text-align: center;
width:5%;
height: 5%;
}
.logo {
margin: 10%;
text-align: center;
}
.confirm-text {
max-width: 30px;
display: block;
}
.example-container {
display: flex;
flex-direction: column;
}
.example-container>* {
width: 100%;
}
.example-right-align {
text-align: right;
}
input.example-right-align::-webkit-outer-spin-button,
input.example-right-align::-webkit-inner-spin-button {
display: none;
}
.example-radio-group {
display: inline-flex;
flex-direction: column;
}
.checkbox {
display: block;
flex-direction: column;
padding-left:4%;
}
strong {
padding-left: 4%;
}
p {
padding-left: 4%;
}
.example-radio-button {
margin: 3%;
}
.example-selected-value {
margin: 15px 0;
}
<mat-card><div class="logo">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRE3x0vsDn1R5O0v7QKVvJNMJK2txXUv8IIsY-2t4R8ore5AjMk0g" alt="image">
<br>
<br>
<p>your return request has been confirmed. please tell us a convenient time to schedule the pick up</p>
</div></mat-card>
<mat-card class="login-form">
<form class="example-container" (ngSubmit)="onSubmit(f)" #f="ngForm">
<strong>Pick up your preferred date</strong>
<mat-radio-group class="example-radio-group" name="selectedDate" [(ngModel)]="selectedDate" required>
<mat-radio-button class="example-radio-button"
*ngFor="let date of dateOptions" [value]="date" ngDefaultControl>
{{date}}
</mat-radio-button>
</mat-radio-group>
<br><br>
<strong>Select a preferred time</strong>
<mat-radio-group
class="example-radio-group" name="selectedTime" [(ngModel)]="selectedTime" required>
<mat-radio-button class="example-radio-button"
*ngFor="let time of timeOptions" [value]="time" ngDefaultControl>
{{time}}
</mat-radio-button>
</mat-radio-group>
<hr>
<mat-checkbox class="checkbox" name="confirmation" [(ngModel)]="confirmation" required>
<span class="confirm-text">I confirm the above selected date and time as the preferred slot for return pick up.</span>
</mat-checkbox>
<hr>
<button mat-raised-button color="accent" type="submit" [disabled]="!f.valid">Submit</button>
</form>
</mat-card>
edit: this is index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Myntra</title>
<base href="/">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://storage.googleapis.com/code.getmdl.io/1.1.0/material.indigo-pink.min.css" rel="stylesheet" /
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<app-root></app-root>
</body>
</html>