HTML & CSS class inside paragraph tags, cannot pass validator

Viewed 38

I need to format a few words in my text body using CSS. I have within paragraph tags my class. The validation errors I get are as follows:

1.

Error: Element resort not allowed as child of element p in this context. (Suppressing further errors from this subtree.)

From line 28, column 26; to line 28, column 33

"resort"> Pacif

Content model for element p: Phrasing content.

Error: Element resort not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

From line 39, column 9; to line 39, column 16

↩ Pacifi

Content model for element div: If the element is a child of a dl element: one or more dt elements followed by one or more dd elements, optionally intermixed with script-supporting elements. If the element is not a child of a dl element: flow content.

/* This is a single-line comment */

/* This is
a multi-line
comment (uses same start and close tags as single-line comment!) */

/* Note to self: CSS seems to still use the same format as an HTML document but only gives the styles */

<!DOCTYPE html>
<html lang="en">
<head>
<title>pacific</title>
<meta charset="utf-8">
<style>

header {
  background-image: url(sunset.jpg);
  background-position: right;
  background-repeat: no-repeat;
  line-height: 400%;
  text-indent: 1em;
}

body { font-family: Arial, Helvetica, sans-serif;
  background-color: #FFFFFF;
  color: #555555;
}

/* Style the h1eader */
h1 {
  background-color: #002171;
  color: #FFFFFF;
  margin-bottom: 0;
}

/* Style the h2eader */
h2 {
    color: #1976D2;
  }

  /* Style the navigation pane */
nav {
    font-weight: bold;
    text-decoration: none;
    background-color: #BBDEFB;
}

dt {
    color: #002171;
}
/* Style the footer */
footer {
  background-color: #f1f1f1;
  padding: 10px;
  text-align: left;
  font-style: italic;

  /* can I please center this?  It looks so much better!  */
}
p resort {
    color:#1976D2;
    font-weight: bold;
}

/* This is for future use (according to text book) */

main {

}

contact {

}
<!DOCTYPE html>

<html lang="en">
<head>
    <title>Pacific Trails Resort</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="pacific.css">
</head>



<header>
  <h1>Pacific Trails Resort</h1>
</header>
    
      <nav>
        <strong><a href="index.html">Home</a> &nbsp; <a href="yurts.html">Yurts</a> &nbsp; <a href="activities.html">Activities</a> &nbsp; <a href="reservations.html">reservations</a></strong>
      </nav>
    <div>
<!--Large image goes here-->


    </div>
    
<main>

      <h2>Enjoy Nature in Luxury</h2>
      <p class="resort"> <resort> Pacific trails resort</resort> offers a special lodging experience on the California North<br>
      Coast with panoramic views of the Pacific Ocean. Your stay at Pacific Trails<br>
      Resort includes a sumptuously appointed private yurt and a cooked-to-order<br>
      breakfast each morning.</p>
      <ul>
        <li>Unwind in the heated ourdoor pool and wirlpool</li>
        <li>Explore the coast on your own or join our guided rours</li>
        <li>Relax in our lodge while enjoying complimentary apetiezers and beverages</li>
        <li>Savor nightlyfine dining with on ocial view</li>
      </ul>
      <div>
        <resort>Pacific Trails resort,</resort> <br>
        12010 Pacific Trails Road<br>
        Zephyr, CA 95555<br>
        <br>
        888-555-5555<br>
        <br>
      </div>
      </main>
      <footer>
        <small>copyright ©2020 Pacific Trails Resory<br>
        <a href="mailto:mw24396@georgiasouthern.edu">mw24396@georgiasoutehrn.edu</a></small>
      </footer>
    
  </style>
  </html>

1 Answers

This would be because there is no html tag called resort

<resort></resort>

what you most likely are wanting to do is turn it into a span with a class

<span class="resort__title">...</span>

.resort__title {
  color:#1976D2;
  font-weight: bold;
}
<p class="resort"> <span class="resort__title"> Pacific trails resort</span> offers a special lodging experience on the California North<br> Coast with panoramic views of the Pacific Ocean. Your stay at Pacific Trails<br> Resort includes a sumptuously appointed private
  yurt and a cooked-to-order<br> breakfast each morning.</p>

Related