Home > Software engineering >  Layout change when change from web to mobile
Layout change when change from web to mobile

Time:08-01

how can I do this layout happen in angular? I don't want to add bootstrap. Image one is when viewing the page in web browser on laptop and image two is when viewing using a phone.

image one

image two

CodePudding user response:

You can use

HTML:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="style.css">
    <body>
        <div >
            <div ></div>
            <div ></div>
        </div>
    </body>
</html>

CSS:

/* desktop */
.bigDiv {
    display: flex;
    flex-direction: row;
}
/* mobile */
@media only screen and (max-width: 600px) {
    .bigDiv {
        display: flex;
        flex-direction: column-reverse;
    }
}
  • Related