css:rwd:responsive-web-design
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
css:rwd:responsive-web-design [2023/08/08 21:50] – odefta | css:rwd:responsive-web-design [2023/08/08 21:56] (current) – odefta | ||
---|---|---|---|
Line 69: | Line 69: | ||
The inclusion of this meta tag helps to optimize the display for different devices and ensures that the responsive design techniques applied via CSS work as intended. Without this tag, some mobile browsers might default to a viewport width that is wider than the device, causing the page to render as a scaled-down version of the full desktop site. By including this tag, the developer instructs the browser to render the content in a way that is more suitable for the screen' | The inclusion of this meta tag helps to optimize the display for different devices and ensures that the responsive design techniques applied via CSS work as intended. Without this tag, some mobile browsers might default to a viewport width that is wider than the device, causing the page to render as a scaled-down version of the full desktop site. By including this tag, the developer instructs the browser to render the content in a way that is more suitable for the screen' | ||
+ | |||
+ | ===== Media query description ===== | ||
+ | |||
+ | The **@media** rule is used in CSS to apply styles only when certain conditions are met. It's a cornerstone of responsive web design, allowing developers to create different layouts for different devices or screen sizes.\\ | ||
+ | |||
+ | Here's what the specific rule ;;;@media only screen and (max-width: 600px);;; means: | ||
+ | |||
+ | * **@media**: This is the introduction to a media query, telling the browser that the following conditions will define when certain styles are applied. | ||
+ | * **only screen**: This part restricts the styles inside the media query to screen devices only. It ensures that the styles are not applied to other media types like print. The word only is used to prevent older browsers that don't support media queries with media features from applying the given styles. | ||
+ | * **(max-width: | ||
+ | This means that ;;;if you are viewing the website on a device or window that is 600 pixels in width or narrower, the CSS rules inside this media query will take effect.;;; | ||
+ | |||
+ | |||
css/rwd/responsive-web-design.1691520607.txt.gz · Last modified: 2023/08/08 21:50 by odefta