...

View Full Version : can i do <br class="...."> ?



canadianjameson
09-27-2004, 11:42 PM
i tried the following:



<style type="text/css" media="print">
#notUnderlined { text-decoration: none}
.Hide { display: none; }
.notPrinted { display: none; }
.static-box { display: block }
.onlyPrinted { display: block }
#bottomMiddle {
position: absolute;
margin-left: 40%;
bottom: 0px;
page-break-after:always; }
</style>

<style type="text/css" media="screen, projection">
.notPrinted { display: block }
.static-box { display: none }
.Hide { display: none; }
.onlyPrinted { display: none }
...
</style>

...

in body
....
<div align="center"><a href="#" class="notPrinted" onClick="window.print();return false;" style="color:#0000FF" border="0">Click here to print this page</a></div>
<br class="onlyPrinted">
<table ...>


basically i want a space there only on the printout, because the print link is being removed and collapses a line down. cant i do <br class="onlyPrinted">?

gsnedders
09-27-2004, 11:47 PM
Nothing stopping you from doing so...

canadianjameson
09-28-2004, 02:33 AM
the space shows on the screen...?

]|V|[agnus
09-28-2004, 02:39 AM
Why not just adjust the margins on surrounding elements, and forego the <br /> altogether?

rmedek
09-28-2004, 02:41 AM
what about just adding a little extra margin or padding on the offending div in the printout rather than using a <br>?

<edit> d'oh! man, you're fast...:)</edit>

canadianjameson
09-28-2004, 02:42 AM
elaborate kind sir.

basically because if this worked then it would be easier like this... why doesnt it work?

afterthougt:
should i do <br class="onlyPrinted"></br>

would that do anything?

rmedek
09-28-2004, 02:47 AM
elaborate kind sir.
Well, if you had this:
<style type="text/css" media="print">
div {
margin-bottom: 10px;
}
</style>

<div>stuff that's going to be printed</div>

... then you wouldn't need to add a br at all. The printed part gets a little space added to it to make up for the link that disappears.

canadianjameson
09-28-2004, 02:50 AM
cool, i'll try it later. i'm sick as a dog and about to pass out.

thanks

]|V|[agnus
09-28-2004, 03:08 AM
basically because if this worked then it would be easier like this... why doesnt it work?

maybe somebody's trying to tell you something...

Why would more verbose and less intelligent CSS and markup be easier than less and more of each respectively?

canadianjameson
09-29-2004, 12:50 AM
in short, because i wanted to :)

i still do...

any chance you could explain why my br thing isnt working?

and besides, wouldnt adding more bottom padding simply extend it downwards?

AaronW
09-29-2004, 01:01 AM
You can put a class on a <br />. If you don't want that <br /> with the class to show up, set it to display: none. Otherwise, it's display: inline.

canadianjameson
09-29-2004, 01:11 AM
but i tried (as seen in my first post in this thread) and the <br> showed up on the screen.

what did i do wrong there?

AaronW
09-29-2004, 01:21 AM
Just for kicks, try putting TWO <br class="onlyPrinted" /> and see what that does... I'd have figured this would work.

canadianjameson
09-29-2004, 01:39 AM
the blinkin br space still shows up on the screen!

why god why!

AaronW
09-29-2004, 01:50 AM
Wait, just a space? As in it leaves a " " but doesn't do a line break?

If that's the case... Remove all whitespace around your <br /> tag, maybe?

canadianjameson
09-29-2004, 02:12 AM
blast it all.

this is what i want on the screen:

Line 1
Line 2 .... class=notPrinted <-- disapears on printout
--- NOT ON SCREEN -- <br class="onlyPrinted">
Line 3

and on the printout it would show:
Line 1
<br class="onlyPrinted">
Line 3

what i get on the screen is this:
Line 1
Line 2
<br class="onlyPrinted">
Line 3

the onlyPrinted class wont seem to come into effect for the <br> tag!

]|V|[agnus
09-29-2004, 04:20 AM
for the love of dog man, just use margins...

tsguitar2004
09-29-2004, 04:21 AM
Margin has been the best option I've seen here (I've been lurking). We'll have to start coding without that <br> tag soon enough; might as well start now...
-ts

canadianjameson
09-29-2004, 05:42 AM
margins scare me

do you have a simple tutorial i could look at?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum