Skip to content

Commit b12aba2

Browse files
committed
Proofread; reconcile differences between code snippets in Readme and code in drop-in.css
1 parent 9d2cff4 commit b12aba2

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,9 @@ header h1 {
199199
float: left;
200200
}
201201

202-
header nav ul {
203-
list-style: none;
204-
float: right;
205-
}
202+
header nav { float: right; }
203+
204+
header nav ul { list-style: none; }
206205

207206
header nav li {
208207
display: inline-block;
@@ -227,9 +226,9 @@ The general **header** rule just puts 1rem of padding around all four sides of t
227226
In the **header h1** rule, we specify that any and all **\<h1>** elements in the **\<header>** should be rendered at a size of 3rems. Our CSS selector for the rule, "header h1", won't touch **\<h1>**s in any other element of the app&mdash;for example, an **\<h1>** in the **\<main>** element will be displayed at its default size, not at the 3rems specified in this rule. We also set the **header h1** to **float: left**, so that it displays against the left margin of the header section.
228227

229228
#### header nav
230-
The rest of the styles in the "Header Styles" section deal with the components of the header's **\<nav>** element. To be sure that we don't affect list or nav elements elsewhere in the app, we begin each selector with a mention of both the **\<header>** and the **\<nav>** types. The **header nav ul** rule eliminates the bullet points that appear by default on unordered lists.
229+
The rest of the styles in the "Header Styles" section deal with the components of the header's **\<nav>** element. To be sure that we don't affect list or nav elements elsewhere in the app, we begin each selector with a mention of both the **\<header>** and the **\<nav>** types. The **header nav** rule, which specifies **float: right**, pushes the nav links to the right-hand margin of the header. The **header nav ul** rule eliminates the bullet points that appear by default on unordered lists.
231230

232-
In the **header nav li** rule, **display: inline-block;** changes the links in the nav bar to appear on a horizontal row, instead of a vertical list. The "border-left" property establishes a vertical border between each pair of links, and the **header nav li:first-child** rule _turns off_ that border for the first link on the nav bar.
231+
In the **header nav li** rule, **display: inline-block;** changes the links in the nav bar to appear as a horizontal row, instead of a vertical list. The **border-left** property establishes a vertical border between each pair of links, and the **header nav li:first-child** rule _turns off_ that border for the first link on the nav bar.
233232

234233
#### header nav input[type="submit"]
235234
The last rule in this section, which styles **header nav input[type="submit"]** elements, is necessary because HTML and Sinatra all but _require_ the "logout" link to be created as a button. Since ending the current session requires a POST route with a hidden input to carry the "delete" action, it is usually created as a single-button form, rather than as a simple link. This rule removes the border and background from the button, so that it looks and behaves like the other links in the nav bar; recall that we set the colors for this input in the "Colors" section, above.
@@ -293,7 +292,7 @@ Almost every index view in a Sinatra or Rails app is going to display some sort
293292

294293
Forms are also very common in Sinatra and Rails apps, but again, the default styling for them is generally pretty ugly and unfriendly. We'll handle this mostly by styling the form input elements.
295294

296-
First, we'll set the **display** property of **main input** elements to **block**, so each one appears on its own line on the page. If you add a label for an input, it will default to **display: inline**, so labels will show up to the left of the text box they identify. If you prefer labels on the line above, you can add the following style rule to your CSS file:
295+
First, we'll set the **display** property of **main input** elements to **block**, so each one appears on its own line on the page. If you add a label for an input, it will default to **display: inline**, so labels will show up to the left of the text box they identify. If you prefer labels on the line above, you can add the following style rule to your CSS file to put them there:
297296

298297
```css
299298
main label { display: block; }
@@ -317,7 +316,6 @@ main td {
317316
width: 25%;
318317
padding: 0.25rem 0;
319318
text-align: center;
320-
border: 1px solid #222;
321319
}
322320
```
323321

drop-in.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* jeffstrap.css */
1+
/* drop-in.css */
22

33

44
/* RESETS */
@@ -86,13 +86,9 @@ header h1 {
8686
float: left;
8787
}
8888

89-
header nav {
90-
float: right;
91-
}
89+
header nav { float: right; }
9290

93-
header nav ul {
94-
list-style: none;
95-
}
91+
header nav ul { list-style: none; }
9692

9793
header nav li {
9894
display: inline-block;
@@ -116,6 +112,8 @@ main {
116112
clear: both;
117113
}
118114

115+
/* Lists */
116+
119117
main ul { margin: 0 auto 1.5rem; }
120118

121119
main ul li {
@@ -124,13 +122,18 @@ main ul li {
124122
font-size: 1.25rem;
125123
}
126124

125+
/* Forms */
126+
127127
main input {
128128
display: block;
129129
margin-bottom: 0.75rem;
130130
width: 100%;
131131
}
132132

133-
main input[type="text"] { padding: 0 0.5rem; }
133+
main input[type="text"],
134+
main input[type="password"] {
135+
padding: 0 0.5rem;
136+
}
134137

135138
main textarea {
136139
width: 100%;
@@ -141,6 +144,8 @@ main textarea {
141144

142145
main input[type="submit"] { width: 12rem; }
143146

147+
/* Tables */
148+
144149
main table {
145150
width: 100%;
146151
margin-bottom: 1rem;

0 commit comments

Comments
 (0)