Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Print CSS

Hi i am building a web page work order form in html and i am stuck on making a print style sheet. in the print.css file i am wanting to exclude the logo and make it print landscape.. any ideas?

5 Answers

shit i feel dumb.. i forgot to put href="css/print.css" "css/ in front of print.css..

Thanks

No problem, friend. I can't tell you how many times that a project of mine hasn't been working because I forgot one simple thing.

I once forgot to include a CSS file for a jQuery plugin and messed around for half an hour trying to figure out what was wrong. Boy, did I feel dumb after that.

the orientation in the css is not working ;/

Use a print media query:

@media print {
    /* place your styles in here */

    .logo {
        display: none;
    }
}

Is this what you're looking for?

it seams like the print.css is not being pulled..

here is the html / css connector..

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

Hmm...try using the media query. I don't recall having used the media="print" method before.

Also, are you looking at the page in print preview or are you still in your normal browser view?

print preview.. and what do you mean by just using the media query.. i put that query in the print.css file..

If you're using the media query, you probably don't need a separate file for the print styling.

Open the development tools in your console. Do they display any errors?

it said.. "Failed to load resource: the server responded with a status of 404 (Not Found).. print.css

The browser can't find print.css; the link element probably has the wrong path to print.css.

ya lol, I've been trying to figure that out for a hour or so :(..

the orientation in the css is not working ..