118 lines
2.2 KiB
Markdown
118 lines
2.2 KiB
Markdown
|
|
---
|
||
|
|
id: 5f3c866dd0d0275f01d4d847
|
||
|
|
title: Part 38
|
||
|
|
challengeType: 0
|
||
|
|
---
|
||
|
|
|
||
|
|
## Description
|
||
|
|
<section id='description'>
|
||
|
|
|
||
|
|
Well that did not work. The reason is, by styling the `p` elements as `inline-block`, placing them on a separate lines in the code, there is an extra space that adds to the right of the first `p` element, so the second one shifts to the next line. There are a couple of ways to handle this. One way is to make each's width a little less than `50%`.
|
||
|
|
|
||
|
|
Change the `width` value to `49%` for each class to see what happens.
|
||
|
|
|
||
|
|
</section>
|
||
|
|
|
||
|
|
## Tests
|
||
|
|
<section id='tests'>
|
||
|
|
|
||
|
|
```yml
|
||
|
|
tests:
|
||
|
|
- text: Test 1
|
||
|
|
testString: ''
|
||
|
|
|
||
|
|
```
|
||
|
|
|
||
|
|
</section>
|
||
|
|
|
||
|
|
## Challenge Seed
|
||
|
|
<section id='challengeSeed'>
|
||
|
|
|
||
|
|
<div id='html-seed'>
|
||
|
|
|
||
|
|
```html
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8" />
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
|
<title>Camper Cafe Menu</title>
|
||
|
|
<link href="styles.css" rel="stylesheet" type="text/css" />
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="menu">
|
||
|
|
<header>
|
||
|
|
<h1>CAMPER CAFE</h1>
|
||
|
|
<p>Est. 2020</p>
|
||
|
|
</header>
|
||
|
|
<main>
|
||
|
|
<section>
|
||
|
|
<h2>Coffees</h2>
|
||
|
|
<article class="item">
|
||
|
|
<p class="flavor">French Vanilla</p>
|
||
|
|
<p class="price">3.00</p>
|
||
|
|
</article>
|
||
|
|
<article class="item">
|
||
|
|
<p>Carmel Macchiato</p>
|
||
|
|
<p>3.75</p>
|
||
|
|
</article>
|
||
|
|
<article class="item">
|
||
|
|
<p>Pumpkin Spice</p>
|
||
|
|
<p>3.50</p>
|
||
|
|
</article>
|
||
|
|
<article class="item">
|
||
|
|
<p>Hazelnut</p>
|
||
|
|
<p>4.00</p>
|
||
|
|
</article>
|
||
|
|
<article class="item">
|
||
|
|
<p>Mocha</p>
|
||
|
|
<p>4.50</p>
|
||
|
|
</article>
|
||
|
|
</section>
|
||
|
|
</main>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
<html>
|
||
|
|
```
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id='css-seed'>
|
||
|
|
|
||
|
|
```css
|
||
|
|
body {
|
||
|
|
background-image: url(https://tinyurl.com/coffee-beans-fcc);
|
||
|
|
}
|
||
|
|
|
||
|
|
h1, h2, p {
|
||
|
|
text-align: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.menu {
|
||
|
|
width: 80%;
|
||
|
|
background-color: burlywood;
|
||
|
|
margin-left: auto;
|
||
|
|
margin-right: auto;
|
||
|
|
}
|
||
|
|
|
||
|
|
.item p {
|
||
|
|
display: inline-block;
|
||
|
|
}
|
||
|
|
|
||
|
|
--fcc-editable-region--
|
||
|
|
.flavor {
|
||
|
|
text-align: left;
|
||
|
|
width: 50%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.price {
|
||
|
|
text-align: right;
|
||
|
|
width: 50%;
|
||
|
|
}
|
||
|
|
--fcc-editable-region--
|
||
|
|
```
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</section>
|