Learn Enough HTML to Be Dangerous | Learn Enough to Be Dangerous
You have to make a choice. Choose...wisely.

Get occasional notifications about things like product discounts, blog posts, and new or updated tutorials. Unsubscribe at any time.

Quick Checkout
or Pay by Credit Card
Error processing your payment
  • You didn't choose whether or not to be added to the mailing list
Confirm
$0.00

Payments and credit card details are securely managed and protected by Learn Enough's payment processor, Stripe. More information on their site:

CART
Total
$0.00

Your Cart is Empty

$30
$300
$300
$XY
$XY
1234
Get Single Tutorial
MORE INFO

Learn Enough HTML to Be Dangerous is available as an ebook, an offline video series, and as a structured, self-paced online course. The course includes full online access to the book content, streaming videos, progress tracking, exercises, and community exercise answers.

All Access Subscription
MORE INFO

The Learn Enough All Access Subscription includes the entire Learn Enough introductory sequence and the full Ruby on Rails Tutorial. More than 2500 pages of book content and 53 hours of video that teach you to code from total beginner up to professional-grade web development.

Sign up for the course and get access to the full tutorial and streaming screencasts!

2.4.2 Exercises

  1. Why might the images shown in Figure 2.11 not match your results exactly? Hint: It’s not a bug, it’s a feature.
  2. The kitten image in Figure 2.9 is available under a Creative Commons license that requires attribution. We’ll fulfill this requirement by linking the image on our page to the original image’s URL, which involves nesting the a and img tags, as shown in Listing 2.13. (Be sure to replace FILL_IN with the right URL.) How does this change the page’s (a) appearance and (b) behavior?
  3. Under the first paragraph on index.html, let’s add a link to the Learn Enough Twitter account. First, download the Twitter logo as shown in Listing 2.14. Then, add a link to both the text and the logo image, as shown in Listing 2.15. Be sure to replace FILL_IN with the right path to the image. Note that Listing 2.15 introduces inline styling, which is the subject of Chapter 4. Extra credit: Follow Learn Enough on Twitter here.
Listing 2.14: Downloading the Twitter logo.
$ curl -o images/small_twitter_logo.png \
>      -L https://cdn.learnenough.com/small_twitter_logo.png

Note that the backslash \ should be typed, but your shell will include > automatically, so don’t just copy and paste the whole thing.

Listing 2.15: Adding links to the Learn Enough Twitter account. index.html
      .
      .
      .
      for our official email list</a> now.
    </p>

    <p>
      <a href="https://twitter.com/learnenough" target="_blank"
      rel="noopener" style="text-decoration: none;">
        <img src="FILL_IN">
      </a>
      You should follow Learn Enough on Twitter
      <a href="https://twitter.com/learnenough"
         target="_blank" rel="noopener">here</a>.
    </p>
    .
    .
    .

Join the Mailing List

Get occasional notifications about things like product discounts, blog posts, and new or updated tutorials. Unsubscribe at any time.