Difficulty encountered when applying border-radius to a fixed image

One interesting thing I tried was anchoring an img tag with its own link and then styling it using the following CSS code:

a{
      border-color: white;
      border-width: 2px;
      border-radius: 50%;
      border-style: solid; 
  }

The result was quite unexpected as the borders only appeared at the bottom of the image, leaving the upper, right, and left portions without any borders. Additionally, there was a small white oval near the upper-left corner of the image. However, when I applied the same styling to just the image tag like this:

img{
      border-color: white;
      border-width: 2px;
      border-radius: 50%;
      border-style: solid; 
  }

everything looked perfect and the borders were uniform across all sides.

By the way, here is the HTML code for the image:

<a href="a45.jpg">

                <img width= 800px src="a45.jpg" alt="alternative for image" >

        </a>

I'm no coding expert, so please explain in simple terms if possible.

View the original image here

Answer №1

It was mentioned in the feedback to eliminate the center tag

.a <- this is referring to the class name a

You likely intend to target all anchor elements

a{

}

The same applies to img, remove the period

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

Reposition and resize an image. Creating a grid layout

I'm having trouble with positioning and cropping an image correctly on my website. I want it to look like this (hero-section): The entire project is based on a grid layout. I need a circular image that is larger than the container, positioned to the ...

The WebDriver encountered an error while trying to click on an element

When using Selenium WebDriver, I am facing an issue with selecting an item from a drop-down list. The element I want to click on is labeled as "game club". Despite attempting to select different elements, I keep encountering an error stating that none of ...

Is there a way to alphabetically and numerically organize a table in vue.js?

Currently, I am implementing sorting functionality for a table using vue.js. While I have successfully achieved ascending sorting for numbers, I am facing challenges with getting the descending and alphabetical sorting to function properly. Below is the H ...

"Utilizing a custom CSS style for a half heart rating system

I am currently working on implementing a rating system using the font-awesome fa-heart class. While I have successfully colored the full heart, I am facing difficulty in filling only the first half of the heart in red. Despite my research efforts, all solu ...

Remove the borders on the right and left sides of a Bootstrap table that has

I have a table structured like this: <table class="table table-hover table-bordered"> The table currently has borders on all four sides of each cell. I am looking to remove the left and right borders while keeping the top and bottom borders intact. ...

Retrieving the special attribute value from a div element

When running the following command: console.log(document.getElementById('container')); The output is as follows: <div id="container" prjid="ABCDE">...</div> But why does the next command: console.log(document.getElementById(&a ...

Is your idTabs design in need of some sprucing up

Just stumbled upon idTabs and trying to implement a basic one on my server. I've taken the code from the 'Usual' page, included the plugin file and jQuery, but all I'm seeing is... - Tab 1 - Tab 2 - Tab 3 This is tab 1. Seems like it& ...

How can I pass a specific value, rather than the entire array, in a ReactJS dropdown menu?

I am facing a problem where the entire array is being passed as an argument when I call onchange after getting correct values in the dropdown. Instead of only receiving the selected value, e contains the whole array. Here is the code snippet that demonst ...

Showing ngx-dropdowns within a table while utilizing the overflow visible property

I am experiencing an issue with the NGX dropdown menu within a scrollable table. The problem arises on the last row, where the dropdown is cut off due to the overflow being hidden by default. https://i.sstatic.net/2JfUY.png To address this issue, I appli ...

Selenium has the ability to input data in various fields, however, it encounters difficulty when attempting to input data

driver.find_element_by_id('username').send_keys('thisIsAString') Although Selenium is successfully typing in the password fields, it's encountering an issue with the username field. Despite using the same code for both fields, the ...

Highlight a section of the innerHTML code

Currently, I am working on creating a table that will showcase the dates of the upcoming 10 days. In order to populate the table with the day, date, month, and year, I have implemented the following JavaScript code: document.getElementById(i).innerHTML = ...

Divide the PHP code into individual statements and align half of the data to the right

I wrote the following code to split my for each statement into two separate divs: <?php $previousLetter = false; ?> <?php $i=1; // setting a counter variable foreach($this->clubs as $clubs) : ?> <?php $firstLetter = substr($ ...

Displaying or hiding table columns in Vue.js Element-UI el-table based on screen width: a step-by-step guide

Here is my code snippet for generating a table: <el-table :data="tableData" empty-text="No data to display :( " v-if="window.width > 855"> <el-table-column v-for="column in tableColumnsMd" :key=&q ...

Tips for displaying a message in a concealed field with jQuery

I have an input field that saves values for checking a specific condition. When the condition is false, I want to display a message. If the field is hidden, the message will not be displayed. HTML <input type="hidden" id="year1_req_fund_hidden" name= ...

Adjust the color of the button upon hovering with CSS

I'm having trouble changing the text color from white to black when hovering over the button. The code seems fine, but the text color isn't changing. Can anyone help me figure out how to make it work? .main__btn { font-size: 1.2rem; back ...

Notification box for displaying database information in HTML table layout

I am currently facing an issue where I have data from a database that I want to display in an HTML table inside an alert box. The problem is that the data is not appearing in the correct format within the alert box, it is simply displaying as text. Here is ...

Are programmatic clicks distinguishable from manual clicks in JQuery?

Currently, I am in the process of creating selectable and draggable elements for a table. You can test the functionality by following this JsFiddle link (please try vertically selecting). Initially, the selection works well but upon trying to select for th ...

Troubleshooting: Jquery UI Draggable - Cursor losing track of draggable element

I want to create a draggable popup with Jquery UI functionality, but I'm facing an issue where the cursor does not stay aligned with the popup element when dragged. When dragging the popup element to the left, the mouse cursor goes beyond the div elem ...

Using external components, such as antd, with Style JSX in a NextJS project is not functional

I am exploring the use of Style JSX within a Next JS application to customize AntD components, with a focus on customizing the appearance of the sidebar (specifically using Style JSX to modify AntD's Sider component). Below is a snippet of the code I ...

Progress Bar Modules

I am currently working on creating a customizable animated progress bar that can be utilized as follows: <bar [type]="'health'" [percentage]="'80'"></bar> It is functional up to the point where I need to adjust different p ...