Using HTML and CSS, generate the convergence of lines and a circle

Could someone guide me on how to display a pointer on a world map, similar to the one shown below?

I managed to create a circle using HTML/CSS. Here is the code for the one I created:

.circle {
border-radius: 50%/50%; 
width: 50px;
height: 50px;
background: black;

}

http://jsfiddle.net/sreeram62/8QRAJ/

Now, I'm looking to add 2 intersecting lines along with an image as shown in the example above. Is this achievable using html/css?

Thank you

Answer №1

You have the option to utilize the pseudoelements :after and :before in a creative manner, demonstrated in this particular example

This technique is universally supported by all major browsers (IE9+) as outlined here

.circle {
    border-radius: 50%/50%; 
    width: 50px;
    height: 50px;
    background: black;
    position: relative;
    top: 200px;
    left: 50%;
}
.circle:after {
    content: '';
    display: block;
    height: 1px;
    width: 300px;
    position: absolute;
    top: 50%;
    left: -125px;
    background-color: #f00;
}

.circle:before {
    content: '';
    display: block;
    height: 300px;
    width: 1px;
    position: absolute;
    left: 50%;
    top: -125px;
    background-color: #f00;
}

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

Steps to Retrieve and Showcase a Compilation of YouTube Clips with JavaScript

Recently, I managed to write a C code that retrieves the list of YouTube videos from the URL "*http://gdata.youtube.com/feeds/api/standardfeeds/top_rated*" using the libsoup library. By utilizing libxml2, I was able to parse the XML data and extract specif ...

Triggering a click event on two separate modal divs

I am encountering an issue regarding click events on various modal divs. I have a modal div 'A' that displays an overlay div with specific information. This div is shown by clicking a button labeled A. Therefore, if this overlay div is displayed ...

Dynamic parallax or stacked vertical text animation

I am attempting to replicate the text effect found on . The text is centered both vertically and horizontally within each div, but as you scroll down, the top position shifts creating a parallax effect. As you continue scrolling, the text transitions to th ...

Toggle Visibility of Div or Element

While exploring a website, I came across a feature that really caught my attention but I'm having trouble figuring out how to recreate it! XD Can anyone lend a hand? I am interested in emulating the copyright notification on this site for my own webs ...

What is the best way to show and hide the information in a FAQ section when each one is clicked?

const faqItems = document.getElementsByClassName("faq-question"); const faqContents = document.getElementsByClassName("faq-content"); for (item of faqItems) { console.log(item); item.addEventListene ...

Automate populating input fields with data

I need help with a form that has four input boxes. Is it possible to automatically fill the remaining three input boxes with the value entered in the first box when the user clicks a button using JavaScript? Or should I aim to prefill the textboxes with ...

"Utilizing a background image within a component to completely cover the entirety

Hey everyone, I need some help with a confusing issue. I'm currently working on an AngularJs project and I am struggling to set a background image for a specific component without affecting the entire application. My goal is to have the image cover t ...

"Enhance Your Website with jQuery's Dynamic Multi-Animation

I'm facing an issue with my website where, upon clicking the contact link in the navigation bar, a contact box slides down and the navigation bar moves below it. However, when the contact link is clicked again to hide the contact box, the navigation b ...

Retrieving player statistics through the NHL API

I've been struggling for the past two weeks to figure out how to fetch player stats from this NHL API when a player is clicked. You can see an example of what I'm trying to achieve by clicking on this player stats link. Any assistance with this w ...

Delete the initial double line break and then switch the remaining double line breaks to single line breaks

I am facing an issue with some HTML content fetched from an external source. My aim is to specifically target instances of double br tags using jQuery. I want to delete the first occurrence of double br and convert all subsequent occurrences into single br ...

The CSS property for setting the background color on the body element is not functioning properly

I am attempting to make changes to my app.scss file in my Symfony 4 project. Unfortunately, the background-color property is not being applied as expected. body { background-color: #ccccff; } In my base.html.twig file, I have the following structure: ...

Two sections that are supposed to have the same height, but one seems to be slightly taller than the other

Upon closer inspection: At first glance, they may appear identical at certain zoom levels. However, a more detailed examination through zooming in and out reveals a noticeable discrepancy. Firefox's default zoom may make them seem incorrect, while Chr ...

The program encountered an error while trying to access the undefined property '_header'

An issue arises when the app.use(express.static("web")) line is executed. var express = require('express')(); var app = express(); var http = require('http').Server(app); var io = require('socket.io')(http); //app.get(&apo ...

Using Angular to scroll within a <div> that is obstructed by other <div>s and concealed by

I am currently in the process of developing a website using Angular. I have implemented a card feature that allows for text selection from a menu on the left side. The texts are displayed using the *ngIf directive. However, I encountered an issue where if ...

What is the best way to hide the jQuery modal I created?

Hello everyone! Currently, I am working on coding a simple JS modal that can be opened and closed smoothly. The issue I am facing is related to adding a click function to (.black-overlay) in order to fade out everything and close the modal. <div class ...

Choosing a particular 2D array based on another variable in jQuery and JavaScript

Within my project, I am utilizing 2D arrays to append specific divs under particular circumstances. In an effort to streamline and enhance the code, I attempted to create a variable that would determine which array to utilize based on the id of an HTML < ...

Encountering a problem with the mouseup event

Hey there, I've got this code up and running smoothly but I'm looking to make a tweak. Is there a way to have the script halt on the mouse up event? Currently, it displays coordinates as you drag over an image, but I'd like it to only show ...

Creating a navigation bar with an active tab feature using Nuxt.js and Vue

Currently, I am working on a side navbar and attempting to activate it based on the page click. The sidenav.nav is a component that I am using for this purpose. <template> <aside class="col-md-3"> <nav class="list-group ...

When the header is given a fixed position, the modal becomes unattainable

I am currently working on developing my personal news website called News Pews. This is my third project, and I have encountered an issue that was not present in my previous projects. The problem arises when I apply position: fixed; top:0; to the header c ...

Ways to dynamically assign a class to a single element within a group of identical elements

I have three identical items in the DOM. Specifically, I am referring to a moving line <span class="caret"></span> <ul> <li class="nav-item-1"> <a href="#">ITEM 1</a> <span class="caret"></span> ...