![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I try to define this @media print { span.red {border: 1px solid black; background-color: red} } and use it in html code by this way p>Color: <span class=red> </span> red</p If I do the same for @media screen then this work as expected, but not for @media print. I can't to find if this is feature or cross browsers bug ;-) |
|
To explain what I can do: I want to create a small rectangle filled by some color, in this example red. I tried to use span, div, table, p, but nothing work for printer. What is the right way? |
|
Please reply to <petr AT practisoft DOT cz |
#3
| ||||
| ||||
|
|
I try to define this @media print { span.red {border: 1px solid black; background-color: red} } |
|
and use it in html code by this way p>Color: <span class=red> </span> red</p |
|
If I do the same for @media screen then this work as expected, but not for @media print. I can't to find if this is feature or cross browsers bug ;-) |
|
To explain what I can do: I want to create a small rectangle filled by some color, in this example red. I tried to use span, div, table, p, but nothing work for printer. What is the right way? |
#4
| |||
| |||
|
|
I try to define this @media print { span.red {border: 1px solid black; background-color: red} } and use it in html code by this way p>Color: <span class=red> </span> red</p Resolved ;-) |
#5
| |||
| |||
|
|
Resolved ;-) I found that all mostused browsers are able to print colored border, so I rewrote my code. @media print { span.red { margin: 0; padding: 0; border-width: 8px 8px 0 8px; border-color: #ff0000 !important; font-size: 1px; } } p>Color: <span class=red> </span> red</p |
#6
| |||
| |||
|
|
Petr Vileta wrote: snip Resolved ;-) I found that all mostused browsers are able to print colored border, so I rewrote my code. @media print { span.red { margin: 0; padding: 0; border-width: 8px 8px 0 8px; border-color: #ff0000 !important; font-size: 1px; } } p>Color: <span class=red> </span> red</p Not in my browsers... Please can you tell me what browser are you using? I suppose some "graphic" |
#7
| |||
| |||
|
|
Jonathan N. Little wrote: Petr Vileta wrote: snip Resolved ;-) I found that all mostused browsers are able to print colored border, so I rewrote my code. @media print { span.red { margin: 0; padding: 0; border-width: 8px 8px 0 8px; border-color: #ff0000 !important; font-size: 1px; } } p>Color: <span class=red> </span> red</p Not in my browsers... Please can you tell me what browser are you using? I suppose some "graphic" browser, not text-based ;-) |
#8
| |||
| |||
|
|
You see printing color backgrounds is a *user* setting which is off by default in browsers. |
#9
| |||
| |||
|
|
Yes, as already explained in the thread. But now Petr presented code (failing to provide a URL, thereby making testing more difficulting) that creates a colored box using _border_ properties. I can't to provide URL because this is password protected "admin" pages. |
|
That's a creative invention, but at least as implemented in the code, I'd expect the idea to fail on any browser where a minimum font size has been set (the code apparently relies on setting font size to 1px) or that has been set to ignore font size settings on web pages. Thank you for mention of 1px font size. What do you think - what font size can |
#10
| |||
| |||
|
|
Thank you for mention of 1px font size. What do you think - what font size can be minimal value to not be ignore/overwrite by browsers? 3px? I use IE6 and FF2 only and not have experience with other browsers. |
![]() |
| Thread Tools | |
| Display Modes | |
| |