remove margin around checkbox

Posted on 2006-07-10
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
LVL 18

Assisted Solution

Eternal_Student earned 250 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now