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
css for printing - problem with margin
Old 08-12-2008, 10:23 AM css for printing - problem with margin
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
For some reason I can't get rid of the 175px left margin. It continues to be there when I try to print the page.

Here's the default:

.twoColFixLtHdr #mainContent {
border-right-width: thin;
border-right-style: none;
border-right-color: #666699;
border-left-width: thin;
border-left-style: solid;
border-left-color: #666699;
margin-top: 10px;
margin-right: 0;
margin-bottom: 0;
margin-left: 175px;
padding-top: 0;
padding-right: 20px;
padding-bottom: 0;
padding-left: 20px;
}

And the print.css version:

div #mainContent {
margin-left: 0px;

}

What am I doing wrong?
missingtime is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-12-2008, 10:53 AM Re: css for printing - problem with margin
Skilled Talker

Posts: 84
Location: Brussels, Belgium
Trades: 0
Quote:
Originally Posted by missingtime View Post
For some reason I can't get rid of the 175px left margin.

.twoColFixLtHdr #mainContent {
margin-left: 175px;
}
What am I doing wrong?
That's because you put margin-left: 175px; between {}.
You should leave it out of it, or reduce it to 0 or try -175 or something like that.
__________________

Please login or register to view this content. Registration is FREE
Bulevardi is offline
Reply With Quote
View Public Profile
 
Old 08-12-2008, 11:38 AM Re: css for printing - problem with margin
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
I don't think you read all the way to the bottom. I did change the left margin in my print.css file. (It's 175px in my default.css.)
missingtime is offline
Reply With Quote
View Public Profile
 
Old 08-12-2008, 03:31 PM Re: css for printing - problem with margin
Super Talker

Posts: 107
Name: Sandy
Trades: 0
.twoColFixLtHdr #mainContent {
margin-left: 175px;
}

And the print.css version:

div #mainContent {
margin-left: 0px;

}

What am I doing wrong?[/quote]

Just a guess but shouldn't your print file be exactly the same class name?
ie... .twoColFixLtHdr #mainContent?
__________________
Sandy K
sandyk3 is offline
Reply With Quote
View Public Profile
 
Old 08-12-2008, 04:43 PM Re: css for printing - problem with margin
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Agree with Sandy, the class and ID names MUST match.
Quote:
That's because you put margin-left: 175px; between {}.
CSS rules belong inside braces, so it HAS to be in between.

If you're going to use this:
div #mainContent {
margin-left: 0px;

}

then it should be div#mainContent - no spaces, though the div in front likely isn't necessary at all.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

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


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

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-13-2008, 08:29 AM Re: css for printing - problem with margin
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
Ok...I made the changes. Now everything matches. However, I still have the same problem. I can't get rid of that left margin.

In the head area of the page I have this:

<link href="print.css" type="text/css" rel="stylesheet" media="print">
<link href="default.css" rel="stylesheet" type="text/css" />

Is that the problem?
missingtime is offline
Reply With Quote
View Public Profile
 
Old 08-13-2008, 11:53 AM Re: css for printing - problem with 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
Normally you want to place the print stylesheet after your regular stylesheet, so that its rules will override the regular rules by default. I haven't looked closely at your code, but this is the normal way to do things.
__________________
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 08-14-2008, 08:07 AM Re: css for printing - problem with margin
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
That was it!!

Problem solved.
missingtime is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to css for printing - problem with 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.26571 seconds with 12 queries