Add extractor and builder
Tested and working
This commit is contained in:
@ -6,14 +6,10 @@ tags: layout,intermediate
|
||||
Given an element of variable width, it will ensure its height remains proportionate in a responsive fashion
|
||||
(i.e., its width to height ratio remains constant).
|
||||
|
||||
#### HTML
|
||||
|
||||
```html
|
||||
<div class="constant-width-to-height-ratio"></div>
|
||||
```
|
||||
|
||||
#### CSS
|
||||
|
||||
```css
|
||||
.constant-width-to-height-ratio {
|
||||
background: #333;
|
||||
@ -31,8 +27,6 @@ Given an element of variable width, it will ensure its height remains proportion
|
||||
}
|
||||
```
|
||||
|
||||
#### Demo
|
||||
|
||||
#### Explanation
|
||||
|
||||
`padding-top` on the `::before` pseudo-element causes the height of the element to equal a percentage of
|
||||
|
||||
Reference in New Issue
Block a user