I’m building a jQuery form-field validator, and at the moment I’m working on building in the pop-up notifications in CSS.
The problem is, I can’t get .notification-point to align to the center of .notification-body, regardless of the application of margin-top/padding-top properties.
Here’s a link to my JsFiddle: http://jsfiddle.net/Z6Jtd/8/
Any help/edits would be greatly appreciated!
Solution: http://jsfiddle.net/vonkly/Z6Jtd/9/
There you go.
Note: I changed your javascript a little. I removed .fadeOut; I would highly recommend creating a function for
.focusout()– or better yet, detect changes to the value and when it matches the required rule, hide the message.For future readers:
The solution to this issue was to wrap both the marker (“point”) and the body (“message”) in a container with
position: relative;on it.Then, I positioned the marker using
position: absolute;andtop: 8px.Next, I added
margin-left: 12pxto the message in order to not overlap the marker.CSS
note: above code is modified to not take up loads of room with
border-radius, etcHTML
note: on notify-wrap, i added the class
x1to define a specific error message to keep in line with the OP’s original formatting for javascript.Javascript (jQuery)