CSS CSS Layout CSS Layout Techniques Float

Ben Risinger
Ben Risinger
3,909 Points

Create a new rule that targets the img element. Add the property and value that takes the image out of the normal page f

Create a new rule that targets the img element. Add the property and value that takes the image out of the normal page..

style.css
.img {
  float: right;
}
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Developer Diane's blog</title>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <header>
    Developer Diane’s Blog
  </header>
  <article>
    <section class="intro">
      <img src="developer-diane.jpg" alt="Developer Diane coding on her laptop.">
      <h1>The verdict is in. CSS Layout is great!</h1>
      <p class="clear">I’ve been working with CSS for a while now, and I have to say, it’s pretty awesome. I love being able to separate content from presentation, and to keep all my styles in an external stylesheet.</p>
      <p>I’ve had a pretty good grasp on the basics for a while now, but I needed to learn more about how to control layout with my CSS. Understanding CSS layout meant first exploring the parts of the CSS box model.</p>
    </section>
    <footer>©2020 Developer Diane.</footer>
</body>
</html>
Ben Risinger
Ben Risinger
3,909 Points

I don't know why my brain decided to stop working here. I feel like I am missing something very simple.. any help would be appreciated!

1 Answer

Zaid Khan
Zaid Khan
12,740 Points

Hi Ben Risinger

The challenge asks to wrap text around of the img element to its right side.

So by using float left on the image it will make the text go on the right side.

Like this:

img {
  float: left;
}