CSS / FLOATS PRACTICE · STEP 1 OF 6
Wrap a study-club newsletter
Checking your account…
GUIDED PRACTICE
Wrap a study-club newsletter
Open styles.css for this step. Follow the checklist, keeping your earlier work. If a named comment is missing from an older saved draft, add it without deleting your work. Keep index.html unchanged during this step.
Your code stays in one editor through every step. Word wrap is enabled.
Step 1 of 6
Let the first paragraph wrap
A float moves the image to one side and lets following text wrap alongside it. Ordinary images start inline; their size can still make a line look full. We will size the first photo before floating it.
Your task
Open styles.css for this step. Follow the checklist, keeping your earlier work. If a named comment is missing from an older saved draft, add it without deleting your work. Keep index.html unchanged during this step.
To pass this step:
- In
styles.css, add a rule with selector.intro-photooutside all media blocks, directly below theSTYLE CLASS INTRO PHOTOcomment. - Set its
widthproperty to160px. - Set its
floatproperty toleft. - Look for the first paragraph alongside the photo, on its right.
Press the play button labeled Run & check this step below the editor to run your code and see your check results.
Your editor is opening.
Each step builds on the last. Finish the current step before opening the next one; your code stays with you.
This is one possible solution. Compare it with your own code; opening it does not replace your work or complete a step.
/* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
/* STYLE CLASS NEXT STORY */
/* STYLE CLASS FEATURE PHOTO */
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
/* STYLE FOOTER LATER RULE 2 *//* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
.intro-photo {
margin-right: 16px;
margin-bottom: 16px;
}
/* STYLE CLASS NEXT STORY */
/* STYLE CLASS FEATURE PHOTO */
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
/* STYLE FOOTER LATER RULE 2 *//* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
.intro-photo {
margin-right: 16px;
margin-bottom: 16px;
}
/* STYLE CLASS NEXT STORY */
.next-story {
clear: both;
}
/* STYLE CLASS FEATURE PHOTO */
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
/* STYLE FOOTER LATER RULE 2 *//* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
.intro-photo {
margin-right: 16px;
margin-bottom: 16px;
}
/* STYLE CLASS NEXT STORY */
.next-story {
clear: both;
}
/* STYLE CLASS FEATURE PHOTO */
.feature-photo {
width: 160px;
float: right;
}
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
/* STYLE FOOTER LATER RULE 2 *//* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
.intro-photo {
margin-right: 16px;
margin-bottom: 16px;
}
/* STYLE CLASS NEXT STORY */
.next-story {
clear: both;
}
/* STYLE CLASS FEATURE PHOTO */
.feature-photo {
width: 160px;
float: right;
}
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
.feature-photo {
margin-left: 16px;
margin-bottom: 16px;
}
/* STYLE FOOTER LATER RULE 2 *//* Add the float, size, spacing and clear rules as you go. */
/* STYLE BODY */
body {
margin: 20px;
font-family: Arial, sans-serif;
line-height: 1.5;
color: #17283c;
}
/* STYLE CLASS INTRO PHOTO AND CLASS FEATURE PHOTO */
.intro-photo,
.feature-photo {
width: 280px;
height: 220px;
object-fit: cover;
border-radius: 8px;
}
/* STYLE FOOTER */
footer {
margin-top: 24px;
padding: 12px;
background-color: #e0f2fe;
}
/* STYLE CLASS INTRO PHOTO */
.intro-photo {
width: 160px;
float: left;
}
/* STYLE CLASS INTRO PHOTO LATER RULE 2 */
.intro-photo {
margin-right: 16px;
margin-bottom: 16px;
}
/* STYLE CLASS NEXT STORY */
.next-story {
clear: both;
}
/* STYLE CLASS FEATURE PHOTO */
.feature-photo {
width: 160px;
float: right;
}
/* STYLE CLASS FEATURE PHOTO LATER RULE 2 */
.feature-photo {
margin-left: 16px;
margin-bottom: 16px;
}
/* STYLE FOOTER LATER RULE 2 */
footer {
clear: both;
}Code and completed steps save in this browser when signed out. Sign in to save across devices.
Choose the copy to continue. Your account work will only be replaced if you choose this device.
Ready to checkRun the checks to see your results here.