/    Sign up×
Community /Pin to ProfileBookmark

Keep input background from printing

I have some input boxes with the background-color style set. I want it to not print out in color. My users only print in black and white and the color is leaving the text box with a gray background. Yes I could take the color out of the text boxes, but I want to know if there is a solution. Here is my page:

[CODE]
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<style type=”text/css”>
<!–

*{
margin: 0;
padding: 0;
}
#cell1 {
position:absolute;
left:4px;
top:116px;
width:366px;
height:265px;
z-index:2;
text-align: right;
font-family:”Times New Roman”, Times, serif;
font-size:18px;
}
#cell1 input{
border: dotted 1px black;
size: 18px;
font-size: 18px;
margin-bottom: 2px;
background-color: #FF0000;
color: #FFF;

}

}
–>
</style>
</head>

<body>
<div id=”cell1″>
<label>DR Cover/Foam/FSB Plastic
<input name=”name1″ type=”text” id=”name1″ value=”<cfoutput>#Recordset1.name1#</cfoutput>” size=”12″ maxlength=”12″ />
</label>
<br />
Pass IB Sideshields
<input name=”name2″ type=”text” id=”name2″ value=”<cfoutput>#Recordset1.name2#</cfoutput>” size=”12″ maxlength=”12″ />
<br />
Pre Track Pass
<input name=”name3″ type=”text” id=”name3″ value=”<cfoutput>#Recordset1.name3#</cfoutput>” size=”12″ maxlength=”12″ />
<br />
Pass FSB Stuff
<input name=”name4″ type=”text” id=”name4″ value=”<cfoutput>#Recordset1.name4#</cfoutput>” size=”12″ maxlength=”12″ />
<br />
OB Pass FSB Marriage
<input name=”name5″ type=”text” id=”name5″ value=”<cfoutput>#Recordset1.name5#</cfoutput>” size=”12″ maxlength=”12″ />
<br />
Pass Pretensioner/TIB
<input name=”name6″ type=”text” id=”name6″ value=”<cfoutput>#Recordset1.name6#</cfoutput>” size=”12″ maxlength=”12″ />
<br />
Spare
<input name=”name7″ type=”text” id=”name7″ value=”<cfoutput>#Recordset1.name7#</cfoutput>” size=”12″ maxlength=”12″/>
<br />
<input name=”hiddenField” type=”hidden” id=”hiddenField” value=”<cfoutput>#Recordset1.nameid#</cfoutput>” />
</div>
</body>
</html>

[/CODE]

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@RonBurgundyauthorFeb 14.2008 — Hmmm..not seeing a solution for this on the site. I looked at the CSS tips, but couldn't find anything.
Copy linkTweet thisAlerts:
@felgallFeb 14.2008 — Just define how you want it to print in the media="print" stylesheet.
Copy linkTweet thisAlerts:
@RonBurgundyauthorFeb 14.2008 — Here is my page:

[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" media="print" href="test2.css" />
<style type="text/css">
<!--

*{
margin: 0;
padding: 0;
}

#cell1 {
position:absolute;
left:4px;
top:116px;
width:366px;
height:265px;
z-index:2;
text-align: right;
font-family:"Times New Roman", Times, serif;
font-size:18px;
}
#cell1 input{
border: dotted 1px black;
size: 18px;
font-size: 18px;
margin-bottom: 2px;
background-color: #FF0000;
color: #FFF;

}

}
-->
</style>
</head>

<body>
<div id="cell1">
<label>DR Cover/Foam/FSB Plastic
<input name="name1" type="text" class="hide" id="name1" value="<cfoutput>#Recordset1.name1#</cfoutput>" size="12" maxlength="12" />
</label>
<br />
Pass IB Sideshields
<input name="name2" type="text" id="name2" value="<cfoutput>#Recordset1.name2#</cfoutput>" size="12" maxlength="12" />
<br />
Pre Track Pass
<input name="name3" type="text" id="name3" value="<cfoutput>#Recordset1.name3#</cfoutput>" size="12" maxlength="12" />
<br />
Pass FSB Stuff
<input name="name4" type="text" id="name4" value="<cfoutput>#Recordset1.name4#</cfoutput>" size="12" maxlength="12" />
<br />
OB Pass FSB Marriage
<input name="name5" type="text" id="name5" value="<cfoutput>#Recordset1.name5#</cfoutput>" size="12" maxlength="12" />
<br />
Pass Pretensioner/TIB
<input name="name6" type="text" id="name6" value="<cfoutput>#Recordset1.name6#</cfoutput>" size="12" maxlength="12" />
<br />
Spare
<input name="name7" type="text" id="name7" value="<cfoutput>#Recordset1.name7#</cfoutput>" size="12" maxlength="12"/>
<br />
<input name="hiddenField" type="hidden" id="hiddenField" value="<cfoutput>#Recordset1.nameid#</cfoutput>" />
</div>
</body>
</html>

[/CODE]



and here is my external stylesheet test2.css

[CODE]
#cell1 input{
border: dotted 1px black;
size: 18px;
font-size: 18px;
margin-bottom: 2px;
background-color: #FFFFFF;


}
[/CODE]


What am I doing wrong???!?!?!?
Copy linkTweet thisAlerts:
@ray326Feb 14.2008 — I'd just embed that at the bottom of the existing embedded stylesheet.
×

Success!

Help @RonBurgundy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...