Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media Queries: Clarify that max/min-width include the specified value #29100

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion advanced_html_css/responsive_design/media_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@

Really, that's all there is to it. You can create some complex shifting layouts with just this knowledge alone. You can create an unlimited number of media queries in a single document (Click the 'Edit on CodePen' button so you can resize your screen and see the changes):

<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="css,result" data-slug-hash="yLzYgZw" data-editable="true" data-user="TheOdinProjectExamples" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">

Check failure on line 31 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:31 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) after the tag] [Context: "<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="css,result" data-slug-hash="yLzYgZw" data-editable="true" data-user="TheOdinProjectExamples" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md
<span>See the Pen <a href="https://codepen.io/TheOdinProjectExamples/pen/yLzYgZw">
Media Queries 1 | CSS Responsiveness</a> by TheOdinProject (<a href="https://codepen.io/TheOdinProjectExamples">@TheOdinProjectExamples</a>)
on <a href="https://codepen.io">CodePen</a>.</span>
</p>

Check failure on line 35 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:35 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) before the tag and after the tag] [Context: "</p>"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>

You can also put any number of style definitions inside a media query:

<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="css,result" data-slug-hash="XWempGr" data-editable="true" data-user="TheOdinProjectExamples" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">

Check failure on line 40 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:40 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) after the tag] [Context: "<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="css,result" data-slug-hash="XWempGr" data-editable="true" data-user="TheOdinProjectExamples" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md
<span>See the Pen <a href="https://codepen.io/TheOdinProjectExamples/pen/XWempGr">
Media Queries 2 | CSS Responsiveness</a> by TheOdinProject (<a href="https://codepen.io/TheOdinProjectExamples">@TheOdinProjectExamples</a>)
on <a href="https://codepen.io">CodePen</a>.</span>
</p>

Check failure on line 44 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:44 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) before the tag and after the tag] [Context: "</p>"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>

### Tips

#### Other queries

In all of the above examples, our queries specify a `max-width` which will apply styles to any screen resolution *below* the given style. Said another way: a `max-width` query will apply on any screen up to the defined `max-width`. It is also possible to define a `min-width`, which applies to screens that are *larger* than the given value. `max-height` and `min-height` are also valid.
In all of the above examples, our queries specify a `max-width` which will apply styles to any screen resolution *below* or equal to the specified value. Said another way: a `max-width` query will apply on any screen up to the defined `max-width`. It is also possible to define a `min-width`, which applies to any screen resolution *above* or equal to the given value. `max-height` and `min-height` are also valid.

#### Limit media queries

Expand Down Expand Up @@ -85,9 +85,9 @@

### Assignment

<div class="lesson-content__panel" markdown="1">

Check failure on line 88 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:88 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) after the tag] [Context: "<div class="lesson-content__panel" markdown="1">"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md
1. Look through [Using media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) on MDN. There are a few additional things you can do with media queries that might be worth knowing about, though their usage is much less common.
</div>

Check failure on line 90 in advanced_html_css/responsive_design/media_queries.md

View workflow job for this annotation

GitHub Actions / Lint lesson files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

advanced_html_css/responsive_design/media_queries.md:90 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [Expected a blank line or a code block delimiter (```) before the tag] [Context: "</div>"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md

### Knowledge check

Expand Down
Loading