CamKem's avatar
Level 10

Adding pseudo element using ::before

Hello, I am trying to work out how I can replicate what Laracasts has done when you view a forum thread to move the < div > to the right using ::before to insert a pseudo element.

I have the following CSS that places an element before the content in the div, but the styling on the div is placed around the pseudo element, whereas I wanted to have the styling moved to the right, as per what the Laracasts forum does:

#conversation-stats::before {
    --tw-border-opacity: 1;
    background-color: rgb(235 237 241/var(--tw-border-opacity));
    content: "";
    margin-right: 20px;
    display: inline-flex;
    height: 26px;
    position: relative;
    width: 25px;
    z-index: 1;
}

Can anyone help me with this?

0 likes
1 reply
kokoshneta's avatar

Which part of the Laracast forums does that, exactly? I don’t really understand your description, and from a quick glance at this page in my browser’s inspector, I don’t see any obvious parts of the page that consist of a pseudo-element moving anything…

Can you show in an image what you’re trying to achieve?

Please or to participate in this conversation.