Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How do I force a div to be with 0 margin?
Old 12-16-2008, 07:40 AM How do I force a div to be with 0 margin?
Dakoom's Avatar
Experienced Talker

Posts: 42
Name: Norman
Location: [Italy]
Trades: 0
Check this image: http://img301.imageshack.us/img301/8296/aaec3.jpg. This is a div within a html table. I want to force that div to have no space with the browser's border. How can I do?
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!

Please login or register to view this content. Registration is FREE
Dakoom is offline
Reply With Quote
View Public Profile Visit Dakoom's homepage!
 
 
Register now for full access!
Old 12-16-2008, 07:57 AM Re: How do I force a div to be with 0 margin?
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
try

Code:
body
{
    margin: 0;
    padding: 0;
}
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 12-16-2008, 08:57 AM Re: How do I force a div to be with 0 margin?
Dakoom's Avatar
Experienced Talker

Posts: 42
Name: Norman
Location: [Italy]
Trades: 0
Yup, but try to suppose I have this div into a table with a cellpadding 2. Is there a way I can force this div to have margin: 0 even if it's whitin the table?
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!

Please login or register to view this content. Registration is FREE
Dakoom is offline
Reply With Quote
View Public Profile Visit Dakoom's homepage!
 
Old 12-16-2008, 09:48 AM Re: How do I force a div to be with 0 margin?
Defies a Status

Posts: 2,071
Name: carl
Location: UK
Trades: 0
The div will have zero margin, its the tables cell padding that will mess it up for you, you would have to set cell padding to 0

You can also use a container div but you would still have the same problem if you use tables.

Best thig to do is not to use tables for layout, why would you want to put a div inside a table - your making things hard for yourself and overly complicated, use css for layout and tables for tabular data, you can style the table in the css stylesheet.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by bakerc; 12-16-2008 at 09:51 AM..
bakerc is offline
Reply With Quote
View Public Profile Visit bakerc's homepage!
 
Old 12-16-2008, 11:44 AM Re: How do I force a div to be with 0 margin?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Putting divs inside of tables is a lot like wearing shoes inside your socks.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 12-17-2008, 09:25 AM Re: How do I force a div to be with 0 margin?
Dakoom's Avatar
Experienced Talker

Posts: 42
Name: Norman
Location: [Italy]
Trades: 0
That's becouse I'm on vBulletin, which is created with tables.
Anyway, I have solved by adding zero margin to the table.
Thank you for your replies.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!

Please login or register to view this content. Registration is FREE
Dakoom is offline
Reply With Quote
View Public Profile Visit Dakoom's homepage!
 
Reply     « Reply to How do I force a div to be with 0 margin?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55895 seconds with 12 queries