Is it possible to apply a background color outside of a radius border within a tbody in Chrome?

When styling my table, I encountered an issue with the background color of the tbody and the white space between the border and the table. Here is a snippet of my HTML and CSS:

HTML:

<table>
    <tbody>
        <tr><td>test</td></tr>
    </tbody>
</table>

CSS

table {
    border: 100px solid black;
    border-radius: 100px;
}

tbody {
    background-color: black;
}

td {
    background-color: white;
    border-radius: 100px;
    padding: 100px;
}

http://jsfiddle.net/FKc94/2/

Even after trying to use background-clip, I couldn't get it to work properly. Any suggestions on how to fix this?

Answer №1

To make the background color work, it should be applied to the table element itself:

HTML:

<table>
    <tbody>
        <tr><td>test</td></tr>
    </tbody>
</table>

CSS

table {
    border: 100px solid black;
    border-radius: 100px;
    background-color: black;
}

tbody {
    background-color: black;
}

td {
    background-color: white;
    border-radius: 100px;
    padding: 100px;
}

http://jsfiddle.net/FKc94/4/

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

What is the CSS/HTML code to position text at the bottom of an image overlay in a card design?

I've been attempting to modify the justify-content in the CSS class to "flex-end" and "end," however the text is not relocating to the bottom. My suggestion is that we concentrate on the img-overlay class, as that's where we adjust the position ...

Is there a way to align the logo in the center vertically with the navigation on the right side of the header?

I've been grappling with this issue. I'm interested in exploring various methods to vertically center elements in navigation using semantic HTML. Specifically, I'd like my logo aligned left and the navigation menu aligned right. I attempted ...

Transforming a dynamic HTML layout into a non-responsive one: "RESPONSIVE NO MORE"

I'm currently working with an HTML document that has a responsive design. However, I now need to make it non-responsive. Can someone advise me on the most efficient and fastest way to do this? I attempted using min-width for both html and body, but ...

When the right div is empty, the left div's width increases to 100%

Is there a way to adjust the width of two div elements when floated left so that if the right div is empty, the left div automatically expands to 100% width? if ($('.wrap .box2').is(':empty')) { $('.box2').hide(); $(& ...

What is the best method for developing a draggable element that remains stable?

I have developed a simple script for draggable elements, however, I am facing an issue. Whenever I move the mouse quickly, the element loses focus. Is there a way to improve the stability of the dragging functionality regardless of how fast I move the mou ...

Tips for positioning elements with a background on a mobile-friendly website

Currently, I am working on a responsive website that contains various graphical elements. One specific element includes a series of markers that are displayed along a pathway within the design. The amount of markers on the pathway can range anywhere from 1 ...

Looking for an Icon to accompany the navigation bar on Bootstrap

Can anyone assist me with adding an icon next to the navbar starting from the word "Dashboard" without any spacing using only Bootstrap? Please note that I have tried options like offset-5 and ms-5 but they did not achieve the desired result. <div id=& ...

What is the reason behind the functionality of inline-block?

As a beginner in html and css, I am facing an issue with displaying two h3 elements on the same line. I have tried using display:inline-block, but it's not working as expected. You can check out an example on jsfiddle here. I have provided 4 different ...

HTML Quiz Form Data Submission via Email

I recently designed a quiz using HTML that consists of 5 questions. I have programmed it in a way that only one question appears at a time, keeping the upcoming questions hidden from users taking the quiz. However, since each question is within a separate ...

Step-by-step guide on positioning mid and bottom text using Bootstrap grid system

After searching and trying various solutions, I am still unable to get the desired output. My goal is to use grids in Bootstrap to set the footer layout with the class "link-footer" positioned at the middle height of the div and the class "footer-copyright ...

What could be causing the Contact anchor element to not function properly?

I've been working on creating a dropdown menu for my API, but I'm having trouble getting the anchor links to function properly. I even attempted changing the "a" element to an onclick call with javascript:void(0) and added a function to open Gmai ...

Retrieve the highchart data from a PHP database table

Is there a way to display every row of data from my table in highcharts using PHP to JavaScript for each row? <script> series: [{ name: 'Instant Noodles', data: [<?php foreach ($query as $row){echo $row['noo ...

What is the best way to display all the steps in a Material UI stepper when preparing a page for

I'm currently developing a React component that utilizes Material UI stepper functionality. The challenge I am facing is ensuring that the data is printable effectively. It's necessary for all steps to be expanded and printed, which goes against ...

the display:block property totally ruins my aesthetic

I'm facing an issue with filtering a table using an input box within one of the elements. Whenever I type something in the input box, the table automatically filters its rows based on the input. The strange thing is that when I try to use display:bl ...

What could be causing my sticky positioning to not function properly when I scroll outside of the designated

My website is organized into sections, with each section corresponding to a hyperlink in the navigation menu. I've applied the CSS property position: sticky to my navbar, which works as expected within the section bounds. However, I want my red navbar ...

The text's height adjusts when a unicode character is inserted

I'm working with an HTML element that has text content. The font is set to sans-serif in the CSS, and the text is updated through JavaScript. Sometimes, the text contains just ASCII characters, but other times it includes the "➜" character. You can ...

Invoking an HTML popup within a JavaScript function

Here is a question. In my project, I have the following JavaScript function: <script type="text/javascript" language="javascript"> $(document).ready(function(){ PopUpHide(); }); function PopUpShow(popup_title, pk_post_add){ document.getEl ...

Steps to Implement Dropdown with Multiple Selection in ReactJS

Recently, I've started exploring React and now I'm eager to create a customized select component similar to the one shown in this image: https://i.sstatic.net/D2IDC.png I've successfully created a basic select element like this: <select ...

Is it possible to convert CSS colors to alpha in images?

A few weeks back, I came across a web page discussing the possibility of replacing color areas in an image by applying a color mask and making them transparent. For instance, being able to make white areas transparent on an image of a logo that is placed ...

Aligning HTML form elements side by side

I am having trouble displaying multiple Bootstrap elements and buttons in a single line. Here is an example of what I have: <span><input class="form-control" id="filename" value="Select a ZIP file to upload..." disabled style="display: inline"> ...