What could be the reason for the border not being displayed?

CSS:

.num{
       z-index:8;
       background-color:#ffd200 ;
       width: 180px;
       height: 47px;
       color: #ffd200;
       border:#ffd200 double 6px; 
       border-radius: 20px;
}

HTML:

<div id="ll">
    <table id="num">
        <tr >
            <td class="num"></td>
            <td class="num"> </td>
        </tr>
    </table>

With the above styling and HTML structure in place, what could be causing the border to not appear on the page?

Answer №1

If you're wondering why the border is not visible, it may be because the color of the border (and the text) matches the background color of the element, causing it to blend in.

Take a look at this jsFiddle demonstration - changing the border color will make it stand out.

By adjusting the CSS like this:

.num {
    background-color:#ffd200 ;
    color: #ffd200;
    border: #ffffff double 6px;
}

you can make the border visible. This will create an element with an orange background and a white border, instead of blending the two colors together.

Answer №2

The border becomes visible when the border-color is different from the background-color!

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

Unusual gaps of white space appearing between React components

Currently developing a small web application with multiple components. The backend functionality is all set, but encountering an unusual styling issue. Specifically, noticing a white space appearing between each component without any clear reason. This ga ...

Creating a full-height layout in Bootstrap with a sticky footer

Encountering a minor issue with Bootstrap as I attempt to cover the entire height of the browser window when the content is insufficient. Utilizing Bootstrap within Orchard CMS, in case that impacts the situation. The problem is illustrated in the image b ...

Swap the image (either the last or first child) within a div when it is hovered over

I have multiple Div's on my webpage and I am looking to change the color and image when a mouse hovers over them. Changing the text color from grey to blue is quite simple. CSS #div1:hover{color:#0000CC} If I want to change an image, I can achieve ...

How come the CSS doesn't animate when I use JavaScript to switch the class?

I've implemented the Animate.css library by Daniel Eden, which I obtained from this source. Utilizing the animated (typeOfAnimation) class allows me to easily animate elements on my website. Below is a snippet of my HTML: <button onmouseover="mak ...

Highcharts 3D Pie Chart with Drilldown Feature

How can I create a 3D Pie Chart with Drilldown effect? I am having trouble understanding how it works. Here is a JsFiddle Demo for a 3D Pie Chart: JsFiddle Demo And here is a JsFiddle Demo for a 2D Pie Chart with Drilldown feature: JsFiddle Demo You can ...

Is there a way to create this shape using CSS?

.outer { background-color: #FFB4B4; padding: 40px; text-align: left; } <div class="outer"><h1>Lorem Ipsum nkdsdkjdks diosudisuidus</h1><p>At vero eos et accusam et justo duo dolores et ea rebum. At vero eos et accusam et justo ...

The use of CSS float creates spaces between elements

Is there a way to stack the green DIVs on top of each other without any space between them in the given simple HTML code? I'm puzzled by the gap between the third and fourth green DIVs. * { margin: 0; } .left { width: 20%; background-color: # ...

Exploring the efficiency debate: CSS, JavaScript, and jQuery on performance

As someone new to the world of web design, I work with CSS, JavaScript, and jQuery for developing websites. There are instances where a certain effect can be created using all three. For example, a basic mousehover effect can be accomplished with CSS :hov ...

Aligning a floated element vertically in a list using Bootstrap 4

Is there a way to align a fontawesome icon to the right while keeping it vertically centered? I've attempted using ml-auto and Flexbox, but haven't had any success. Below is the code snippet: <ul class="list-group flex-column"> <li c ...

<v-time-picker> - issue with time selection

<v-time-picker> - Are you certain that the component was properly registered? If dealing with recursive components, remember to include the "name" option <div class="form-inline"> <label for="">Time</label> <v-time-pick ...

Struggling with incorporating CSS and PHP into your web development project?

Struggling to get CSS and PHP to cooperate? For a class assignment, I was tasked with creating a clock that displays different images according to the time of day while also changing the background color. You can find the detailed instructions here. My pro ...

A dynamic and versatile solution for achieving uniform column heights across different web browsers using child elements

Get straight to the point. I'm looking for a solution to create a responsive two-column layout like the one shown in the image below. https://i.sstatic.net/mHhfc.png The width ratio of the .left and .right columns should always be 75/25% relative t ...

Ensure the `div` element expands to fill the entire page even when scrolling

I'm working with a div element called 'alert' that functions similarly to the javascript alert() method. However, I've noticed that it only covers the visible viewport of the page and not the entire content, which becomes uncovered as y ...

Are your DIVs not expanding correctly?

Currently, I am in the process of developing a fansite and I am facing an issue with the "content" class div not expanding as intended. The goal is for it to have a minimum height of 100%, but it seems like this is not happening. Additionally, I am strug ...

Double Row Navbar Struggles in Bootstrap 4

I have been experimenting with creating two bootstrap navbars. The first one features the website's domain name in the center, accompanied by a dropdown menu to navigate to other sections. Each of these sections has its own subbar containing specific ...

Is this the correct method for constructing a class in CSS?

What is the correct way to style a class with CSS and write HTML code? .first{ color:red; } Here is an example of HTML code: <class id=first> <p> some text </p> <p> some other text </p> ...

How can I create a dashed border around a <div> element using HTML and CSS?

On Stack Overflow, I noticed that there are many DIV elements surrounded by dotted lines. How can this be achieved using CSS and HTML? Thank you, Bin ...

Learn how to display my API items in rows of 5 using the Vue framework

Currently, I am utilizing Vue for the front-end development and I am looking to dynamically display 5 items on each row. I want it to appear like this: 1 1 1 1 1 1 1 1 1 1 However, when I iterate through the array items, each item is displayed in a row. ...

What are the steps to resolving the '1' issue in my restaurant.dtd.xml document?

Having trouble with XML Can anyone explain why this specific file is causing an error? file: restaurant.xml <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/css" href="restaurant.css"?&g ...

The incorporation of styled components into the child component seems to be malfunctioning

Even after attempting to include the styled component in the child component, I noticed that the values remained unchanged. The child component displays: <a href='' className='displayCarft'>{props.craftcolor}</a> I have in ...