STYLING EDIT LISTING

 EDIT.EJS

<%- layout("/layouts/boilerplate") %>
  <div class="row mt-3">
    <div class="col-8 offset-2">
      <h3>EDIT listing</h3>

      <form method="POST" action="/listings/<%=listing._id%>?_method=put">
        <div class="mb-3">
          <label for="title" class="form-label">Title</label>
          <input
            name="listing[title]"
            type="text"
            value="<%=listing.title%>"
            class="form-control"
          />
        </div>
        <div class="mb-3">
          <label for="description" class="form-label">Descriptioin</label>
          <textarea name="listing[description]" type="text"class="form-control">
<%=listing.description%>
      </textarea
          >
        </div>

        <div class="mb-3">
          <label for="image" class="form-label">Image</label>
          <input
            name="listing[image]"
            type="text"
            value="<%=listing.image%>"
            class="form-control"
          />
        </div>

        <div class="row">
        <div class="mb-3 col-md-4">
          <label for="price" class="form-label">Price</label>
          <input
            name="listing[price]"
            type="number"
            value="<%=listing.price%>"
            class="form-control"
          />
        </div>
        <div class="mb-3 col-md-8">
          <label for="location" class="form-label">Location</label>
          <input
            name="listing[location]"
            type="text"
            value="<%=listing.location%>"
            class="form-control"
          />
        </div></div>
        <div class="mb-3">
          <label for="country" class="form-label">Country</label>
          <input
            name="listing[country]"
            type="text"
            value="<%=listing.country%>"
            class="form-control"
          />
        </div>

        <button class="btn btn-dark edit-btn">save</button>
      </form>
    </div>
  </div>

STYLE.CSS

/* EDIT LISTING */
.edit-btn{
  margin:0.5rem;
  background-color:#fe424d !important;
  border: none !important;

}

Comments