JavaScript tip bottom right to input field should be responsive

I am new to CSS.

Trying to align these input field validation tooltip this is fiddle: http://jsfiddle.net/fade3r5f/

can anyone help how can I do this.? I can able to move it to left and right but cant able to do like shown in the below image

body {
  padding: 5em 3em;
}
input {
  padding: .5em;
}

p {
  position: relative;
}
.error {
  position: absolute;
  top: -3.5em;
  left: 0;
  padding: .5em 1em .4em;
  background-color: #f66;
  border: 1px solid #f00;
  border-radius: 5px;
  color: #fff;
}
.error::after,
.error::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 15px;
  border: solid transparent;
}
.error::after {
  margin-left: 1px;
  border-top-color: #f66;
  border-width: 7px;
}
.error::before {
  border-top-color: #f00;
  border-width: 8px;
}
<p>
  <input type="text" size="40" />
  <span class="error">Please enter text</span>
</p>

<p>
  <input type="email" size="40" />
  <span class="error">Please enter email</span>
</p>
Answer:1

body {
  padding: 5em 3em;
}
input {
  padding: .5em;
  margin: .5em;
}
p {
  position: relative;
}
.error {
  position: absolute;
  top: -2.6em;
  left: 11em;
  padding: .5em 1em .4em;
  background-color: #f66;
  border: 1px solid #f00;
  border-radius: 5px;
  color: #fff;
}
.error::after,
.error::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 4.5em;
  border: solid transparent;
}
.error::after {
  margin-left: 1px;
  border-top-color: #f66;
  border-width: 7px;
}
.error::before {
  border-top-color: #f00;
  border-width: 8px;
}
<p>
  <input type="text" size="40" />
  <span class="error">Please enter text</span>
</p>

<p>
  <input type="email" size="40" />
  <span class="error">Please enter email</span>
</p>
Answer:2

How can I pass the site_id parameter to pageTitle from data ? .state('site', { url: "/site/:site_id", templateUrl: "views/site_detail.html", data: {pageTitle: 'Site :' + $scope.$...

How can I pass the site_id parameter to pageTitle from data ? .state('site', { url: "/site/:site_id", templateUrl: "views/site_detail.html", data: {pageTitle: 'Site :' + $scope.$...

  1. angularjs pass state parameter to controller
  2. angularjs pass state params
  3. angularjs pass state parameter
  4. angularjs state pass object
  5. angularjs pass data to state
  6. angularjs pass variable to state
  7. angularjs pass multiple parameters to state

I have an array model as below: nodes:[ { id: 1, label: 'label1'}, { id: 2, label: 'label2'}, { id: 3, label: 'label3'} ] I whant to get the label of node filtering by id I tried the next way, ...

I have an array model as below: nodes:[ { id: 1, label: 'label1'}, { id: 2, label: 'label2'}, { id: 3, label: 'label3'} ] I whant to get the label of node filtering by id I tried the next way, ...

  1. filter array objects javascript
  2. filter array objects angular 6
  3. filter array objects
  4. filter array objects js
  5. filter array objects swift
  6. filter array objects jquery
  7. filter array objects angularjs
  8. filter array objects lodash
  9. filter array objects angular2
  10. array filter objects php
  11. filter array of objects by property
  12. filter array of objects typescript
  13. filter array of objects javascript es6
  14. filter array of objects by property javascript
  15. filter array of objects javascript by key
  16. filter array of objects by key
  17. filter array of objects by key value
  18. filter array of objects javascript by value
  19. filter array of objects based on property
  20. filter array of objects javascript based on property

I am trying to download inside div content in text format. I can able to download inside div content in txt format but all the contents are same line . I need to add the line break in each element. ...

I am trying to download inside div content in text format. I can able to download inside div content in txt format but all the contents are same line . I need to add the line break in each element. ...

Assume we have a simple front end and (let's assume Angular if it matters) and a back end app. Say the front end app does a get request. Usually the angular repository makes an $http.get request which ...

Assume we have a simple front end and (let's assume Angular if it matters) and a back end app. Say the front end app does a get request. Usually the angular repository makes an $http.get request which ...