remove margin around checkbox

Posted on 2006-07-10
Medium Priority
Last Modified: 2008-02-01
Hello, I'd like to remove margin around checkboxes on I.E. I tried to remove it by  class="check"

Inside style sheet
margin: 0px;
border: 0px;
But I could not...

Do you know a better way to remove margin around checkboxes??

Question by:portal123
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Assisted Solution

Eternal_Student earned 1000 total points
ID: 17072774
Have you tried setting the margin for the checkbox to a negative value?

I wouldnt really advise that but I know no other way.
LVL 30

Accepted Solution

GrandSchtroumpf earned 1000 total points
ID: 17072793
Add some background color and you'll see it's not margin:

  margin: 0px;
  border: 0px;
  background: red;

It's some sort of padding... but it cannot be removed with "padding: 0;":

  margin: 0px;
  padding: 0px;
  border: 0px;
  background: red;
^----- that does not change anything.

The workaround is to use negative margins:

  margin: 0px;
  border: 0px;

* html .check{
  margin: 0 -2px 0 -3px;

Author Comment

ID: 17079421
Thanks both guys.

I use negative margin and it works well.

Best Wish, portal123

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question