How can you remove the outline of a div in all web browsers using CSS?

I am facing an issue with two divs containing an image that appear split in half. While this layout looks fine in Chrome, other browsers display it with some outline or layout error, causing the document to appear differently than intended. I tried using outline:0; and border:0; to fix this but it didn't work as expected.

Here is how the image should look like in Chrome:

Internet Explorer

FireFox

Safari

CSS:

.login{
    position:absolute;
    left:50%;
    margin-left:-150px;
    top:50%;
    margin-top:-200px;
    width:300px;
    height:400px;
    border-radius:10px;
    text-align:center;
    display:table-cell;
    vertical-align:central;
    padding:0 0 0 0;
    border:0;
    border-style:none;
    outline:0;
}
.login header{
    height:75px;
    width:100%;
    margin-bottom:0;
    padding:0 0 0 0;
    border-style:none;
    outline:0;
    border:0;
}
.login header .logo{
    width:150px;
    height:75px;
    outline:none;
    margin-left:75px;
    border:0;
    border-style:none;
    outline:0;
    background:url(assests/logo_tiny.png) center 0px no-repeat;
    background-color:#000;
    border-radius:75px;
    border-bottom-left-radius:0px;
    border-bottom-right-radius:0px;
    box-shadow:5px 5px 10px #000;
    -moz-box-shadow:5px 5px 10px #000;
    -webkit-box-shadow:5px 5px 10px #000;
    -ms-box-shadow:5px 5px 10px #000;
    -o-box-shadow:5px 5px 10px #000;
}
.login form{
    outline:none;
    width:100%;
    height:245px;
    padding:0 0 0 0;
    padding-top:80px;
    border:0;
    border-style:none;
    box-shadow:5px 5px 10px #000;
    background:url(assests/logo_tiny.png) center -75px no-repeat;
    background-color:#000;
    -moz-box-shadow:5px 5px 10px #000;
    -webkit-box-shadow:5px 5px 10px #000;
    -ms-box-shadow:5px 5px 10px #000;
    -o-box-shadow:5px 5px 10px #000;
    border-radius:10px;
    font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
    color:#FFF;
}

HTML:

<div class="login">
 <header>
 <div class="logo"></div>
 </header>
 <form>
</form>
</div>

Update: Fiddle

Answer №1

Your logo should not have been flattened by mistake.

Originally, it was 150px wide and only 75px high. However, you removed the border-radius at the bottom which caused the issue. To create a circular shadow like this, the entire div must be square with consistent border-radius values on all sides.

Check out the attached fiddle for reference.

http://jsfiddle.net/mbh6W/2/

The line you observed was actually the box shadow of the circle that got flattened at the bottom.

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

JavaScript - Retrieving the variable's name

Whenever I invoke a function in JavaScript with a variable, like this: CheckFunction(MyVariable); CheckFucntion(MyVariable2); Suppose I have a function that checks if the input is a number: function CheckFunction(SOURCE){ //THE CODE ITSELF }; I want to ...

Where will the user's input be stored?

Consider the following HTML code: <div class="form-group"> <label class="col-md-3 col-xs-3 col-sm-3 control-label">Phone</label> <div class="col-md-4 col-xs-4 col-sm-4"> <input id="input ...

Storing a Vue/JS element reference in a constant using Typescript

In my template, I have one form element and one button element: <button type="submit" id="ms_sign_in_submit" ref="submitButton" class="btn btn-lg btn-primary w-100 mb-5"> </button> Wi ...

Obtain Data for Visualizing Graph with JSON within a Database-connected Graph (highchart.js)

In the process of creating a database-driven graph, I am utilizing libraries from Codepen. These libraries include: THIS and Highchart.js The HTML file on display simply showcases the chart, while the main data processing is handled in an index.js file t ...

Are the CSS properties from the parent template automatically applied to the extended child template in Django?

While working on a Django site, I encountered an issue with applying CSS properties to an extended template file. The CSS file was imported in the parent template but the changes were not reflecting in the child template. Here is the snippet of my code: ...

React - Separate colors for different containers

I have been struggling with this issue repeatedly, yet I still haven't found the most efficient solution for it. Imagine having 2 DIVs, A and B, both nested inside a container with columns assigned to each. What would be the optimal way to fill a back ...

Can you apply transparency to a hex color variable in SCSS and then use that variable again?

In my app, I have a set of scss variables that represent colors used throughout the interface. For example: $primary-color: #00755E There are also colors that are variations of this primary color with different opacities. For instance, $primary-color with ...

Vanilla JavaScript Troubleshooting: Top Scroll Button Issue

Attempting to develop a Scroll To Top Button utilizing Vanilla JS, encountering errors in the dev console. Existing jQuery code that needs conversion to vanilla js Uncaught TypeError: Cannot read property 'addEventListener' of null My Vanilla ...

How can we use Angular Table to automatically shift focus to the next row after we input a value in the last cell of the current row and press the Enter key

When the last cell of the first row is completed, the focus should move to the next row if there are no more cells in the current row. <!-- HTML file--> <tbody> <tr *ngFor="let row of rows;let i=index;" [c ...

The submission of the form with the ID "myForm" using document.getElementById("myForm").submit() is

<form name="formName" id="formName" action="" method="post" autocomplete="off"> <input type="hidden" name="text1" id="text1" value='0' /> <input type="button" name ="submit" onClick="Submit()" value="submit"> ...

Resizing the Bootstrap carousel

My website has a custom-sized image that I want to display using Bootstrap's carousel, but I'm struggling with styling the carousel. Here is the result: https://i.sstatic.net/bs9HG.png I'm trying to align the picture in the center. Th ...

Explore the contents of an HTML table with Swift 3

I have obtained the entire HTML code for a specific page on the Vermont Lottery's official website. This page contains a large table that I am interested in extracting data from. Upon successfully fetching the HTML content of the page using some code ...

What is the method for altering the "return" of a CSS transition?

Today, I delved into the world of transitions and I must say, they are amazing and have great potential for future websites. Take a look at my current code: http://jsfiddle.net/Ldyyyf6n/ I am looking to tweak the "return" transition of the circle/square ...

Implement scroll bar functionality on canvas following the initial loading phase

I am currently working with canvas and I need to implement a scroll bar only when it is necessary. Initially, when the page loads, there isn't enough content to require a scroll bar. My project involves creating a binary search tree visualizer where u ...

What is the best way to center elements vertically within a table element?

I'm encountering some issues with my tables. I have created two tables, stacked one below the other, and I am trying to center the elements within them. However, I am facing difficulty in achieving vertical alignment and true centering, as shown in th ...

Excessive width of the lower border

I have a dropdown menu on my website and I wanted to add a border-bottom to the menu. However, the border appears too wide. I went through every step of this solution as it seemed like the same problem, but nothing seems to be working. It would be great i ...

What is the best way to restrict users from accessing more than 5 Bootstrap Tab-Panes at once?

Users are restricted to opening only a maximum of 5 tab panes, even if there are multiple tab buttons available. If the user tries to click on the 6th tab, an alert message will be displayed. function addTab(title, url){ var tabs=$(".tabs"), tab ...

Guide on clearing the value of the first textarea and transferring it to the second textarea using JavaScript

I have encountered an issue where the first textarea value is being copied into the second textarea because I am using the same id for the 'add more' functionality. Below is the code snippet: <div id="divShortAnswerOption_Templated"> & ...

What is the best way to reach nested iframes?

I am looking for a solution to send post messages (window.postmessage) to iframes. Currently, it is functioning properly with a single iframe inside the parent page. However, I want it to also work for nested iframes. Here are the criteria: I should on ...

unusual behavior when using the CSS property transform: rotate

i'm attempting to enable this element to be both draggable and rotatable. However, when I apply transform:rotate(0deg);, I am able to drag it anywhere within the parent container. But when I set it to 90deg, there are certain areas that become undrag ...