I'm striving to replicate a similar layout as shown in the image:
Within a div element containing an image as part of a slideshow, I have utilized :before and :after pseudo-elements to create controls for navigating to the next (>>) or previous (<<) images within the slideshow.
Currently, my code looks like this:
div {
position: relative;
}
div:before {
display:block;
height: 100%;
content: "stuff";
position:absolute;
top: 0; left: 0;
text-align: center;
}
However, I am facing difficulties in centering the content of the pseudo-elements. The text is not aligning properly:
Is there a method to achieve this alignment? If not, what would be the most appropriate workaround while maintaining semantic integrity? I am aiming to centrally align the content within the element without impacting the element itself. Ideally, I would like the element to stretch to 100% height.
Edit: http://jsfiddle.net/rdy4u/
Edit2: Additionally, the image is fluid in nature, with unknown heights for both the div and img elements. The width has been set to 800px with a max-width
of 80%.