Mobile and desktop views are independent applications. Each view has its own CSS layout rules. A developer must prevent one view's styles from affecting the other.
By Pawan Nayar · from the LLOS AI Learning record
Mobile and desktop views are independent applications.
Each view has its own CSS layout rules. A developer must prevent one view's styles from affecting the other.
A developer must treat mobile and desktop as two separate applications. They share HTML and JavaScript. However, they use completely independent CSS layouts. Neither layout should influence the other. This prevents unexpected visual problems across different screen sizes.
A developer creates a website. They put a `display: none` rule for a mobile navigation bar in the base CSS. On desktop, this mobile bar should not appear. But if the desktop CSS does not specifically override this, the mobile bar might accidentally show up on desktop. This happens because the base CSS rule applies to both views.
More from the same record, pulled by shared topic — not written new for this page.
The `.movie-section` is a main part of the page. It has a warm background color.
The `.quote-carousel-section` acts as the main container. The `.quote-carousel-wrapper` sets a maximum width and adds padding.
The main container uses `scroll-snap-type: x mandatory`. This makes items snap into place horizontally.
Use `position: absolute` on the element. This takes the element out of the normal document flow.
Mobile and desktop views are independent applications. Each view has its own CSS layout rules. A developer must prevent one view's styles from affecting the other.