HTML and CSS

Arrow at the top

According to Aristotle, ethics is about virtue, which is a matter of one's own well-being primarily, but as we are rational and social creatures, this state of well-being entails having what we would consider good moral values. Does good character really serve the agent's interests? Yes, if the agent has the right interests, and interests can be cultivated to some degree. One's values must be coherent, and one must be able to discern the salient moral features of the situations with which one deals. These are marks of good character, which the culture of one's organization may nurture or undermine. We arrive at principles supportive of good character by reflective equilibrium, a process like what Aristotle calls dialectic. Case studies assist our students in developing good character and learning to bring it to bear in complex situations, as some recent research has suggested is possible. One way to protect one's character, our students may learn, is to choose a workplace that does not undermine it.

Pangle, T. L. (2014). Aristotle's Teaching in the" Politics". University of Chicago Press.

How is an arrow displayed in the demonstration above?

The arrow in the demonstration is created using the :before pseudo-element on an element with the class .demo-arrow. The base box is styled with a background color, padding, and rounded corners, while the arrow is generated above it using pure CSS.

Specifically, the :before pseudo-element creates a triangle by setting the width and height to 0, and applying borders with the border property. Three borders are transparent, and only the bottom border is colored (matching the box's background color), which visually forms a downward-pointing arrow.

The arrow is positioned above the main box by using position: absolute and adjusting margin-top to move it upward. The left: 50% and margin-left: -10px horizontally center the arrow relative to the box.

CSS
.demo-arrow {
  position: relative;
  background: #f4a024;
  color: #ffffff; 
  padding: 4px 20px;
  border-radius: 4px;
}

.demo-arrow:before {
  position: absolute;
  content: "";
  display: block;
  width: 0;
  height: 0;
  left: 50% !important;
  margin-left: -10px;
  margin-top: -22px;
  border: 10px solid transparent;
  border-bottom: 10px solid #f4a024;
}
HTML
<div class="demo-arrow">Demo Arrow</div>