CSS - Possible To Print White Text?
Does anyone know if it is possible to get text to print white with CSS when printing a page? I know generally you want text black, but this text will be positioned over a black graphic. It seems even when you set the color to white and set it to important in a print style sheet, the print driver sets it to black. Is there any way with a print style sheet to force it to white?
Similar TutorialsI have a page with some very large (dynamically populated) tables in an application. Is there a way to prevent these table from being pushed to a new page when printing? I don't care where the tables break, but what I am trying to avoid is a printed header and then a huge gaping whitespace on the 1st printed page and then the table , that should have been printed just below the header, on a new second page. Any thoughts? Thanks, Stephen I created a print.css for my site, but it still does not work and would appreciate any help. Here's my site: http://seniormobility.org/test/actionplan.html Here's the print.css code: Code: body, .maincopy { background-color: transparent; font-size: 12pt; font-family: "Times New Roman", Times, serif; color: #000000; } #navcontainer, #header, #header_pic, #text_control, #header_breadcrumb #search_box { display: none; } #container { width: 100%; margin: 0; float: none; } #pagename, #main_content, #main_content_home { border: 0; width: 100%; margin: 0 5%; padding: 0; float: none; overflow: auto; } When I do a print preview or actually print in both IE8 and FF, all the text gets cut-off on the right. I'm not sure what I'm missing. Thanks in advance for everyone's help! Hi I am really struggling to get my print stylesheet as it is. The site is http://calibrehr.com/new/ and the stylesheet is http://calibrehr.com/new/print.css If you print preview say the home page in firefox it cuts off the text at the bottom. IE displays this page ok. Could someone please give me some help with reagrd to this problem, and any advice on making print stylesheets!! Thanks alot! Hi all, Simple issue - got a form with textboxes whose screen width will be less than the max width (for design and spacing purposes). However, I'd like the print stylesheet to make the entire contents of the textbox visible when they print. A year or two ago, setting input{width: auto;} in the print stylesheet worked fine, but it seems the newer browsers (IE 6+. latest FF) do not support this method. Any thoughts on how to do this? Thanks, AJ Hi there...First post in this forum cause Firefox (and mozilla / netscape) are driving me mad! Please consider the following code: Code: <html> <head> <style type="text/css"> @media print { p {font-size:11px;text-align:justify;} table {width:100%;} } </style> </head> <body> <table width="770" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC"> <tr> <td> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam molestie, tortor id tempor fringilla, ante massa consequat dui, eget fermentum ante dolor sed felis. Curabitur mollis, velit sit amet lobortis pulvinar, mi lorem condimentum metus, cursus malesuada lectus leo in purus. Suspendisse vehicula, nisl ac varius iaculis, purus felis sodales lorem, in porttitor massa risus a odio. Cras urna felis, sagittis bibendum, ultrices vel, accumsan ac, pede. Maecenas felis nisl, rhoncus non, imperdiet in, tincidunt vitae, ante. Vestibulum cursus, elit non rutrum eleifend, arcu ligula bibendum velit, eget pharetra dui ipsum et tortor. Praesent lectus felis, consectetuer a, varius fringilla, elementum quis, diam. Morbi posuere sem eget odio. Pellentesque imperdiet tellus eget augue. Aliquam et tortor et libero nonummy tristique. Sed feugiat pellentesque sem. In hac habitasse platea dictumst. Vivamus a ipsum eu odio fringilla scelerisque. Ut et neque. Sed fermentum neque nec pede. Morbi enim erat, tempor nec, porttitor eu, tempus ut, nunc. Pellentesque lacinia dapibus urna. Curabitur leo tortor, cursus quis, semper quis, luctus ac, quam. Phasellus sit amet nisl. Nullam molestie nonummy lorem. Etiam consectetuer, ante in lacinia molestie, tellus nisl tincidunt dui, in commodo lectus elit ut elit. In ornare fermentum ante. Nullam felis. Maecenas tempor, lectus vel dignissim tincidunt, metus erat feugiat odio, eu dapibus mauris orci vitae enim. Etiam quis quam vitae risus aliquam iaculis. Ut nunc nulla, hendrerit ut, auctor id, ullamcorper a, risus. Integer fringilla, erat eu interdum imperdiet, lorem purus fermentum wisi, at mattis lectus nisl sit amet ante. Cras dolor. Nunc elementum quam at ligula. Maecenas ut mi ornare neque suscipit vulputate. Praesent ornare. Pellentesque nonummy posuere massa. Morbi sed risus et purus eleifend pulvinar. Proin suscipit ultricies enim. Morbi luctus. Nam quis sem. Quisque mattis. In laoreet velit eu nunc. </p> </td> </tr> </table> </body> </html> This is basically a reconstruction of an existing problem of a far more complex design...in any case, if you try to print->Preview from Opera or IE 5+ everything is sweet...However, Firefox (and the other Gecko browsers) will not properly justify the text when previewing. More precisiely: Firefox will wrap text over 12px correctly yet for small text, the p block will not wrap properly and some text will be cropped. I'm not fussy about justification but even when I removed it I would get the same problem. I'm sure there's a perfectly logical solution to this problem. Maybe the width:100% gets inherited by the td and p but that should not affect the layout...Despite my various experiements of chaging the width and the wrapping properties, I could not solve this. I'm still learning the intricasies of block elements in CSS2 so I would definitely appreciate any help! Thanks in advance, Angelos We're having a weird problem with a print stylesheet - a little bit of the javascript menu appear on the printed over the top of the content. eg: (http://www.lawhandbook.sa.gov.au/ch10.php ) - Print Preview this page and you will see "Chapters A-Z" in the middle. This seems to happen in all browsers. We've looked into many css solutions to the issue - but to no avail - we cant make the damn thing disappear. One long winded solution is to change the stylesheet to be built dynamically - so a call to ch10.php=true would build the page differently. But this seems to defeat the purpose of using a print stylesheet in the first place. Another long winded soltuion is to change the (Rather old) menu script - but that not really an option in this case either. So my question is - What happens when a browser prints a page? Does it send anything back to the server indicating it is loading the print stylesheet instead? (eg: Some sort of request variable) Or does the client's browser simple request the CSS file and reformat the page it has already downloaded? If so I could detect this event with PHP or Javascript to not load the offending menus when the print css had been loaded I have pages the when viewed for print in Firefox, show the page going below the page margin and not continuing to the next logical printed page. This image below, shows better than I can explain. Has anyone ever seen this before?...Any ideas how to make it preview and print correctly? Hi guys .... I've been all over google looking for the answer and nothing I've tried works. I'm trying to make a print-friendly css page but my browsers (FF and IE7) both ignore the CSS and apply their own standards to it no matter what I do, it's driving me positively INSANE because it feels like I've done everything according to the instructions I found online for print CSS. Could you please take a look at my code and make some suggestions? You'd be saving my sanity. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "(URL address blocked: See forum rules)"> <html xmlns="(URL address blocked: See forum rules)" lang="en" xml:lang="en"> <head> <title>CLOColors3</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="mainstyle.css" type="text/css" /> <link rel="stylesheet" href="mainstyleprint.css" media="print" type="text/css" /> the print css: Code: @media print { html{ height:auto;} body{ background-color:#FFF;} #header{ display:none;} #body{ position:relative; background-color:#FFF; background-image:none; height:auto; width:auto; left:0px; top:0px; z-index:0; padding-bottom:0px;} #textbox{ position:relative; overflow:visible; float:none; margin-left: 0px; top: 0px; width:auto; bottom:0px; background-color:#FFF; border:hidden; border-color:#FFF; z-index:0; padding:0px;} #textbox img{ display:none;} .searchbar{ display:none;} #linkbar{ display:none;} .map{ display:none;} .video{ display:none;} #linktext{ display:none;} #clear_both{ display:none;} #menu{ display:none;} #footer{ display:none;} } Currently the main CSS is being used and none of the elements I set to be "hidden" are hidden. Help!!! UPDATE: Ok, so IE seems to be PARTIALLY responding to the print CSS. It responds to all the "display:none;" commands but refuses to format the #textbox div according to my instructions, a border persists and the div has an overflow scrollbar for some reason. Firefox is still unresponsive. Ok guys, I'm hoping someone can help me. I am a complete newbie to CSS and web site construction in general. I have a left vertical navigation bar made up of graphics in a div tag that is set to float on the left. I'm having difficulty with the graphics, they have white spaces in between them when viewed in IE. They are supposed to butt up against one another. I have tried setting the margin and padding in that div to 0. I have also seen in other forums where the <li> tag can be placed on the previous line to fix this problem in IE. I haven't even viewed the page on any other browsers yet, can someone help me please? Thanks so much! vonatah Hi; I am trying to get rid off white space from the bottom of the navigate bar, and tried with height=23px for th or td, but they don't not work, could anyone help me, please. 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>Yourheadstone.com</title> <style type="text/css"> html head title{ border:0; padding:0; margin:0; } body{ padding:0; border:0; background-color:#3399FF; margin:0; } table tr td{ border: 1px solid #000000; } table{ width:1024px; height:25px; padding:0; border:2px solid #000000; margin-top:5%; margin-right:auto; margin-bottom:auto; margin-left:auto; background-color: #E5FFFF; } tr td{ padding:0; margin:0; } #nav { width: 100%; float: left; margin: 0 0 3em 0; padding: 0; list-style: none; background-color: #f2f2f2; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } #nav li { float: right; } #nav li a { display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px solid #ccc; } #nav li a:hover { color: #c00; background-color: #fff; } </style> </head> <body> <table> <tr> <td> <ul id="nav"> <li><a href="#">About Us</a></li> <li><a href="uploadform.php">FAQs</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Headstones</a></li> <li><a href="#">Home</a></li> </ul> </td> </tr> </table> </body> </html> I have layed out the page but cannot seem to get the hang of the floats and positioning....!! If anyone can give me a hint how I can position my text in the main white space I would be so grateful as I am confusing myself as to what i am doing wrong!! the site is hosted at www dot getatrader dot com PLEASE HELP!! here is the CSS: Code: body { background: white; font-size: smaller; font-weight: bold; font-family: Verdana,Arial,Helvetica,sans-serif; } #topnav { float:left; position: absolute; } #topnav img{ display: block; border: none; } #header{ position: relative; text-align: right; border: solid thin #999999; margin: 0px 0px 0px 0px; background: #336699; font-family: Verdana,Arial,Helvetica,sans-serif; color: #ffffff; height: 155px; } #headerright{ position: relative; top: 20px; right: 10px; } #headerright li { display: inline; list-style: none; padding: 40px; } #headerright img { border: none; } #headerright a:link { color: #ffffff; text-decoration: none; } #headerright a:visited { color: #ffffff; text-decoration: none; } #headerright a:hover { color: #ffffff; text-decoration: none; } #headerright a:active { color: #ffffff; text-decoration: none; } h1 { } h2 { width: 200px; text-align: center; color: white; background-color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: large; font-weight: bold; } #container { width: 956px; padding: 10px; margin: 0px auto 0px auto; height: auto; text-align: left; border: 1px solid #ddd; } #button { position: relative; display: block; width: 152px; border-right: 1px solid #000; padding: 0 0 1em 0; margin-bottom: 1em; font-family: Verdana,Arial,Helvetica,sans-serif; background-color: #336699; color: #333; } #button ul { list-style: none; margin: 0; padding: 0; border: none; height: 500px; } #button li { border-bottom: 1px solid #90bade; margin: 0; } #button li a { display: block; padding: 5px 5px 5px 0.5em; border-left: 10px solid #1958b7; border-right: 10px solid #508fc4; background-color: #2175bc; color: #fff; text-decoration: none; width: 100%; } html>body #button li a { width: auto; } #button li a:hover { border-left: 10px solid #1c64d1; border-right: 10px solid #5ba3e0; background-color: #2586d7; color: #fff; } #maintext { position: absolute; float: left; } #footer { color: white; background-color:#336699; font-size: small; font-family: Verdana,Arial,Helvetica,sans-serif; margin: 0px 0px 0px 0px; } Hi, I'm working on a site in Css and it all works fine in Firefox. But in IE7 there is a lot of extra white space between elements like after the h2 heads. Anyone know what i'm doing wrong? Here's the code. CSS Code: body { background: #1d1d1d url(../g/header_bg.gif); background-repeat: repeat-x; margin: 0px; padding: 0px; font-family:arial; font-size:11px; line-height:1; font-weight: normal; text-decoration: none; color:#575859; text-align: left; } #container { width: 992px; margin: 0px auto; text-align: left; } ul { list-style:none; padding: 0px; margin: 0px; } input, textarea{ font-family:Tahoma; font-size:11px; color:#000000; vertical-align:middle; font-weight:normal; background:#FFFFFF; text-align:left; } .formfield { width:271px; height:auto; color:#000000; background-color:#FFFFFF; height:18px; margin-right:8px; border: solid 1px #404040; } #header { height: 63px; } .menu { float:left; padding-top:25px; } .menu li { background:url("../g/menu_sep.gif") right 3px no-repeat; padding:0px 10px 0px 15px; float:left; } .menu li a { background:url("../g/menu_arrow.gif") 0 6px no-repeat; color:#181818; font-weight:bold; padding:0px 10px 0px 15px; text-decoration:none; } .menu li a:hover { text-decoration:underline; } .search { float:right; background:url("../g/search_bg.gif") 0 0 no-repeat; width:357px; height:43px; padding:12px 0px 0px 10px; margin-top:10px; } h1.logo { width: 203px; height: 109px; background: url("../g/title.gif"); text-indent: -9999px; margin-left: 10px; } #left_container { float: left; width: 200px; background-color:#000000; margin-right: 20px; margin-left: 10px; } #middle_container { float: left; } #right_container { float: right; } .left_top { width:200px; height:12px; font-size:0em; background:url("../g/left_top_bg.gif"); } .left_bottom { width:200px; height:12px; font-size:0em; background:url("../g/left_bottom_bg.gif"); } #left_container h2 { font-size:1.01em; line-height:1.5; color:#85B102; font-weight:bold; text-transform:uppercase; padding:0px 0 10px 0; margin-left:20px; } #left_container ul { margin-left:20px;} #left_container li { font-size:1.01em; line-height:1.5em; color:#707070;} #left_container li a { font-size:1.01em; line-height:1.5em; color:#707070; text-decoration:none; background:url("../g/arrow.gif") no-repeat 0px 6px; padding:0 0 0 19px;} #left_container li a:hover { text-decoration:underline;} HTML Code: <html> <head> <title>Test</title> <link type="text/css" href="x/style.css" rel="stylesheet"/> </head> <body> <div id="container"> <div id="header"> <div class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Test2</a></li> <li><a href="#">Test3</a></li> <li><a href="#">Test4</a></li> </ul> </div> <div class="search"> <form method="get" action="search.php"> <input type="text" class="formfield" value=""><input class="submit" type="image" src="g/search.gif" value="submit"> </form> </div> </div> <h1 class="logo">MyTitle</h1> <div id="left_container"> <div class="left_top"></div> <h2>Menu</h2> <ul> <li><a href="#" title="home">Home</a></li> <li><a href="#" title="home">Test2</a></li> <li><a href="#" title="home">Test3</a></li> <li><a href="#" title="home">Test4</a></li> <li><a href="#" title="home">Test5</a></li> <li><a href="#" title="home">Test6</a></li> <li><a href="#" title="home">Test7</a></li> </ul> <div class="left_bottom"></div> </div> <div id="middle_container"> b </div> <div id="right_container"> c </div> </div> </body> </html> http://www.dudley.nhs.uk/ In I.E. 7, when I click on the links in the right hand menu, the whole link/block turns white. Although it doesn't strictly matter (as person gets redirected), I'd like to resolve the issue as it's quite annoying. It works when the code is: Code: .gallery a { text-decoration:none; display:block; padding:5px 5px 5px 20px; width:125px; color:black; background: url(../images/arrow.gif) no-repeat 10px 10px; /* Light green */ } .gallery a:hover { background: url(../images/arrowr.gif) no-repeat 11px 10px; /* Dark green*/ color:black; } but fails when I add a background colour such as: Code: .gallery a, .gallery a:visited { text-decoration:none; display:block; padding:5px 5px 5px 20px; width:125px; color:black; background: #cfc url(../images/arrow.gif) no-repeat 10px 10px; /* Light green */ } .gallery a:hover { background: #3c0 url(../images/arrowr.gif) no-repeat 11px 10px; /* Dark green*/ color:black; } Any clues? Thanks! I have 2 columns. The main one and the sidebar. The problem is that the sidebar extends down the page further then the main column. I am using a color in the background. The color does not extend all the way down. The main area stops about half way down the sidebar and just leaves white space there. The whole page is colored except for this square of white in the middle. Also if I extend the main area content to be longer then the sidebar then the sidebar will have white underneath it instead. Hello Gents, I am trying to get ride of the white space above the menu and above the big sliding banner...Any pointers would be great. getyoursongsmixed.com/wordpress is my site You guys rock thanks Hi - Im new to css and I need to develop a website for IE 6. I am getting a large gap between two divs for an unknown reason - I would like to have them flush against eachother as they seem to appear in IE 8 but not in IE 6. The two divs with the gap a #welcomeandsearch and #welcometext below is the basic html and css I am using: Code: #welcomeandsearch {width:940px; float:left; margin: 0px;} #welcome {width:700px; float:left; color:#FFA000; font-size:1.75em; font-weight:normal; margin: 0px;} #welcometext {width:970px; float:left; padding: 0; margin: 0px;} #search {width:190px; float:left; color:#363636; font-size:0.75em; font-weight:normal;} #searchbox {width:200px; float:left; color:#363636; font-size:1.0em; font-weight:normal;} form input.button {width:25px; height:15px; background:#FFC666; color:#363636; font-weight:bold; border:none; font-size:11px; margin:0 auto; padding:0px;} form input.textfield {color:#363636; font-size:0.75em; font-weight:normal;} <div id="welcomeandsearch"> <div id="welcome">Welcome</div> <div id="searchbox"> <form id="form1" name="form1" method="post" action=""> <label>Search:</label> <input name="textfield" type="text" class="textfield" id="textfield" value="enter keywords here" /> <input name="button" type="submit" class="button" value="Go" /> </form> </div></div> <div id="welcometext">to the Customer Self Help Resource. This online resource has been developed to assist all staff with their most common IT related problems and requests.</div> Any help much appreciated! Does anyone know how to assure that checkboxes and their labels stay together? My situtation: I have several rows, each with several checkboxes. I want to assure that if a line wraps, each checkbox stays with its label (either each stay on the same line, or each move to the next, but never leave checkbox on one line and label on the next). I have tried several varients on: <span style= "whitespace: nowrap;". .... checkbox and label description... </span> or <label style= "whitespace: nowrap;". .... checkbox and label description... </label> even used both... have also tried a non-breaking space between label and checkbox control. <span> works on mac with Netscape, IE, Opera or Safari ... but alas it does not work on windows with IE 5.5 [unfortunately it acts as if 'nowrap' applies to the whole line, forcing viewers to scroll right to see all options] I can find documentation that says "white-space" can apply to <span> or <label>, and also documentation that says it can't. I guess the latter could explain the problem. But does anyone know how to keep the label and checkbox together thanx I added a nav bar to my page. when I did so I now get a white space at the top of the page above the pictures I'm not sure why. Here's a link the the page Dead Link(Link removed because it contained copyrighted content that was more than fair use would allow for. I don't want my friend getting in trouble) any help would be appreciated. I read several threads on devshed, but cannot seem to resolve the issue. I am trying to line up my text and images within a div or span tag with the table just below it such that there is no white space in between. It works in Firefox. Link demonstrating problem in IE: http://test.hmedicine.com/shopping/catalog/kits CSS: .tb{font: 8pt verdana;vertical-align:top;margin-top:0;margin-bottom:0;font-weight:bold} HTML: <span class="tb"> Homeopathic Medicine Shop </span><a href="/shopping/catalog"><img src="/shopping/pics/topbar1shopping.gif" alt="shopping" border="0"></a><a href="/news/guide/guide.php"><img src="/shopping/pics/topbar2.gif" alt="guides" border="0"></a><a href="/shopping/service"><img src="/shopping/pics/topbar3.gif" alt="customer care" border="0"></a><a href="http://www.forum.hmedicine.com/index.php"><img src="/shopping/pics/topbar4.gif" alt="user forums" border="0"></a><br> <table width="720" cellpadding="0" cellspacing="2" bgcolor="009999"> Thanks so much in advance. If it's hard to follow, i can post screenshots. |