Creating a see-through cursor resembling the one found on the App Store using CSS

Currently, Iā€™m struggling a bit with understanding how to accomplish this task:

The issue is that the pointer/arrow within the nav-element appears transparent and displays the content rather than its parent, which is the nav-element.

Here is my HTML code:

<nav>
   ...
   <div id="pointer></div> <!-- this is the arrow -->
</nav>
<div id="content">...</div>

Any suggestions on how to achieve this? Hopefully, my explanation makes sense! :)

Answer ā„–1

After some efforts, I believe I have a starting point for you:

http://jsfiddle.net/uLDzA/2/

The issue lies in the fact that simply setting the ARROW to transparent won't work because the menu div will have a solid color blocking the transparency from showing through to the background.

To resolve this, I divided the menu item into top and bottom sections. The top section contains text while the bottom section is designed to "simulate" a triangle in the middle with a transparent background.

In essence, integrate the arrow into the menu item by assembling it like a CSS puzzle.

<div class="con">
    <div class="item">
        <div class="item_top">
            top
        </div> 
        <div class="item_btm">
            <div class="item_btm_lft">&nbsp;</div>
            <div class="item_btm_ptr">&nbsp;</div>
            <div class="item_btm_rgt">&nbsp;</div>                 
        </div>
    </div>
</div>

.con {
    width:100px;
    height:40px;
    padding:20px;
    background:url('http://placekitten.com/g/100/100');  
}

.item {
    width:100px;
    background:transparent;
}

.item_top {
    background:orange;
    text-align:center;
    color:#fff
}

.item_btm {
    width:100%;
    overflow:hidden;
}

.item_btm_lft {
    width:40px;
    float:left;
    background:orange;
    border-bottom:2px solid orange;

}

.item_btm_ptr {
    width: 0px;
    height: 0px;
    float:left;
    border-style: solid;
    border-width: 0 10px 20px 10px;
    border-color: transparent orange transparent orange;
}

.item_btm_rgt {
    width:40px;
    float:left;
    background:orange;
    border-bottom:2px solid orange;
}

Answer ā„–2

It seems like there might be some confusion here:

From my understanding, the pointer or arrow is actually a separate image file that gets loaded and displayed in certain scenarios, such as when you hover your mouse over something or it becomes active.

To create this effect, you would need to make a new .png file with a transparent background and design it how you want. Any areas on the image where you haven't drawn anything will remain transparent.

Let me simplify it a bit:

If your navigation isn't active and your mouse isn't hovering over it, you should see the default image without the pointer or arrow.

But if we do hover our mouse over it or click it:

Your navigation becomes active and switches to the new image (like a .png file) which replaces the old one. This new image will have parts that are left untouched, making them transparent.

Answer ā„–3

This illustration showcases the innovative use of CSS3 techniques in a contemporary setting, featuring:

The border colors have been customized with partial transparency using the rgba method.

Nevertheless, it is worth noting that while the provided resource explains how to create speech bubbles with triangular designs, it does not provide guidance on replicating the exact layout shown in your screenshot.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

submit content to an iframe on a separate webpage

Work has been a challenge for me lately as I try to achieve a specific task. The starting page features a textbox and a button. My goal is to post the value entered in the textbox to an iframe on a different web page called iframeholder. The catch is tha ...

What are some techniques for identifying duplicate HTML element IDs?

I encountered a challenging bug that took a lot of effort to resolve, only to discover that it was due to two HTML elements having the same ID attribute. Is there a command available to identify duplicate IDs throughout the entire DOM? Update: After rev ...

jQuery Animated List - Nested items are unresponsive to clicks

Looking to create a dynamic nested list using jQuery for animations, but unsure of the best approach. Currently, I'm adjusting the length of the parent list item and revealing the nested items. The issue is that the parent item's length covers ...

Retrieve the HTML tag content as a string using jQuery

For my OSINT project, I am developing a tool that needs to extract text from a specific HTML code string. $("p").text(); I'm looking for a way to make my variable work with the above code. Any suggestions? Share your ideas! Solution: $.ajax({ ...

I'm looking for a Visual Studio add-in that can identify and flag any unused CSS classes or IDs within the entire solution

Exactly as the headline suggests. If not, what are some reliable online services you've tried for decluttering oversized stylesheets? ...

Stop the button from spanning the entire width of its container

Utilizing the Material UI button in my application with customizations as styled-components, I encountered an issue where setting the size="small" prop on the button caused it to only take up the width of the button text with some padding. This behavior pe ...

Undisclosed iFrame technique for uploading files - issue with nested forms

This question seems to be more related to JavaScript/jQuery/DOM rather than Rails, but it's all linked to how I integrated it in Rails. I'm currently working on allowing users to upload multiple photos while creating a new object (auction). The c ...

ScrollReveal.js won't function as intended

https://i.stack.imgur.com/SOQEk.png Looking to utilize the popular ScrollReveal.js created by Julian Lloyd (ScrollReveal) Despite following instructions from various sources, the script is not producing the intended effect. Steps taken to make it work: ...

Aligning Font Awesome icons inside md-buttonsFinding the perfect alignment for

I am attempting to center font awesome icons within a button so that they align perfectly with the text on a toolbar. Below is the code snippet I am working with: <div ng-app="app"> <md-toolbar> <div class="md-toolbar-tools" md-tall ...

Centering a Font Awesome icon within its parent element

Below is the code I am using: <div style="width:60px; height:60px; background-color: lightgrey;"> <a class="" href="javascript:void(0)" style="color: black; width: inherit; height: inherit;"> <i class="fa fa-lg fa-play" aria-hidden="t ...

Creating a full-width input field with text aligned to the right:

.wrap { white-space: nowrap; } input { width: 100%; } body { /* just so you can see it overflowing */ border: 1px solid black; margin: 40px; padding: 10px; } <span class="wrap"><input type="text">.pdf</span> Observing the cod ...

Is the function failing to detect the updated variable because it is not declared as a global variable?

I have created a quiz with 7 select boxes and a submit button, aiming to display a warning error if the select boxes are not changed or show the score if they are changed. I initialized a variable called 'changed' as false. When a select box is ...

Utilize GeoJSON to showcase multiple features in a convenient table format

I am currently facing a challenge in displaying all the features from a GeoJSON file in a tabular format on a website. Despite creating a Leaflet map that successfully shows all the locations from the GeoJSON file, I am struggling to proceed further. My g ...

Displaying photos locally in HTML is not supported

I've encountered an issue with my HTML code. I'm trying to load images from my local drive, and the path to the folder seems correct because I can open the images by ctrl + clicking on them. However, when I open my page using a live server or hos ...

Troubleshooting tip: Resolving the issue of Django forms not functioning correctly within a dynamic HTML page

I've successfully implemented a dorm functionality using Django: #forms.py from django import forms class ContactForm(forms.Form): name = forms.CharField() number = forms.FloatField() eail_user = forms.EmailField() Furthermo ...

How to extract text from outside a tag using Selenium in Python3 with Chrome?

I am having trouble extracting text from outside of a tag. Currently, I am working with Python3.7 and I have experimented with both Selenium and BeautifulSoup4. Below is the HTML snippet I am dealing with: <br> <span class="label">Max. Allo ...

The CSS Calc function is failing to resolve the height property issue

I am in the process of creating a chat plugin and I have encountered an issue with displaying messages. Certain parts of the project had to be concealed due to its confidential nature. Calm before the storm What the >:(( <div id="tab-conversation" ...

List items are not appearing correctly on display

When attempting to design a basic navbar, I encountered an issue where the list items were stacking on top of each other instead of displaying horizontally as intended. The parent container has a position of relative, while the child is set to absolute. ...

Adjust the baseline of text in <li> elements by shifting it 2 pixels upwards

My webpage menu is set up with inline "li" elements within a "ul". Each "li" has a colored border and contains an "a" tag. I'm looking to change the text color inside the "a" tag and move it 2px up when hovering over it without affecting the li border ...

Pressing the icon will trigger a top-sliding dropdown mobile menu to appear

How can I ensure my mobile dropdown menu slides in from the top when the user clicks the "header-downbar-menu" icon and slides out to the top when clicked again? Currently, the button only shows the menu but I am struggling with writing the JavaScript for ...