fix(curriculum): Convert blockquote elements to triple backtick syntax for Responsive Web Design (#35993)
* fix: converted blockquotes to code fences
This commit is contained in:
committed by
Oliver Eyton-Williams
parent
08c4807b09
commit
df8659ab8c
@ -10,7 +10,15 @@ videoUrl: 'https://scrimba.com/p/pzrPu4/cz763UD'
|
||||
Making images responsive with CSS is actually very simple. Instead of applying an absolute width to an element:
|
||||
<code>img { width: 720px; }</code>
|
||||
You can use:
|
||||
<blockquote>img {<br> max-width: 100%;<br> display: block;<br> height: auto;<br>}</blockquote>
|
||||
|
||||
```css
|
||||
img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
```
|
||||
|
||||
The <code>max-width</code> property of 100% scales the image to fit the width of its container, but the image won't stretch wider than its original width. Setting the <code>display</code> property to block changes the image from an inline element (its default), to a block element on its own line. The <code>height</code> property of auto keeps the original aspect ratio of the image.
|
||||
</section>
|
||||
|
||||
|
@ -11,7 +11,14 @@ With the increase of internet connected devices, their sizes and specifications
|
||||
|
||||
The simplest way to make your images properly appear on High-Resolution Displays, such as the MacBook Pros "retina display" is to define their <code>width</code> and <code>height</code> values as only half of what the original file is.
|
||||
Here is an example of an image that is only using half of the original height and width:
|
||||
<blockquote><style><br> img { height: 250px; width: 250px; }<br></style><br><img src="coolPic500x500" alt="A most excellent picture"></blockquote>
|
||||
|
||||
```html
|
||||
<style>
|
||||
img { height: 250px; width: 250px; }
|
||||
</style>
|
||||
<img src="coolPic500x500" alt="A most excellent picture">
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
|
Reference in New Issue
Block a user