The portal about the repair of the bathroom. Useful advice

Web design and search engine optimization. Print the page without unnecessary items The main place is intitle Printable version

Today you are waiting for a note from the series of design tips. And the design is not graphical, but interface design. I think many of you have at least once printed the site page directly from the browser. The sequence is usually like this: Press Ctrl + P, wait a minute, then guess to insert paper into the printer, press Ctrl + P again, surprised why so many banners, counters and the main menu were typing. We needed only a map of travel and contacts.

Some designers decide this question like this: for each page, a separate print version is compacted. Most often it is a document that does not insert banners, menus and other unnecessary page elements.

Why make a separate version

If the page is large, then an option is possible when it does not fit on A4 and is printed only to half, and the rest will be on the second sheet. Removing unnecessary blocks before printing, we will save space on paper, paint in the printer and nerve cells.

In addition, the different resolution of user screens will not allow us to know exactly how one or another item is printed. Therefore, I would advise you to remove everything too much and confident that all printouts will be the same.

How to specify what to print?

Usually, thanks to classes and identifiers of objects, we can hide almost any element of the page. In order not to hide extra, I would recommend to hide the header with navigation, the site logo, the sidebar (if there is) and the footer (bottom of the page).

Thus, in printing, what is in the content area will go. All elements that you want to hide when printing, assign your class, for example "no-print".

We can also specify that the printing should not be sent to the boxes in the banner folder. This is done with a mask. To do this, specify in CSS:

iMG (Display: None! Important;)

With this code, we hide all banners that will meet anywhere on the page. In the same way, the remaining elements should be made invisible.

NO-PRINT (Display: None! Important;)

Application in practice

In order to file print.css. processed only during sending to print, you need to specify it in in this way:

Print this page

A few years ago I was pleasantly surprised by learning about the existence of such a function. It is convenient and simple enough, so I recommend it to use it.

In which he indicated that their pages of a detailed order are unsuitable for use in printed form.

I was stunned when I saw this tweet - I realized that there was a lot of time since I optimized styles for printing and I didn't even think about checking them.

Perhaps this happened because I spend a lot of time to change the size of the browser window to ensure that my sites work fine in all sizes and forms, and maybe I rarely print the page for myself. Regardless of the reasons, I completely forgot about print styles and it is bad.

Optimization of printing web pages is important because the print page we make the site as accessible as possible, regardless of the environment. We should not make assumptions about our users and their behavior. People continue to print web pages. Think about articles, blogs in blogs, recipes, contact information, websites with cards or real estate. Someone ever definitely tries to print one of your pages.

I abandoned home printers for a very long time, as it always seemed to me that they would break after 10 minutes of work. But not everyone like me. - Heidon Picering (Inclusive Design Patterns)

If you notice that you are in a similar position, this post will help you in the rapid refreshment of knowledge. If you have not optimized your print pages, the following tips will help you start.

1. Connecting styles for printing

The best way to connect styles to print is the @Media directive ad in your CSS.

Body (font-size: 18px;) @Media Print (/ * Print Styles Go Here * / Body (Font-Size: 28px;))

Alternatively, you can connect styles in HTML, but this will require an additional HTTP request.

2. Testing

You do not need to print a page every time you have made a slight change in styles. Depending on the browser, you can export the page in PDF, use the preview of printing or debug directly in the browser.

To debug styles to print in Firefox, open the Development Panel (SHIFT + F2 or Tools\u003e Web Developer\u003e Developer Toolbar), enter the Media Emulate Print input field and press ENTER. The active tab before the reboot will work as if the type of media is Print.

Emulation of styles for printing in Firefox

In Chrome, open the developer tools (CMD + OPT + I (MACOS) or CTRL + SHIFT + I (Windows) or the View\u003e Developer\u003e Developer Tools menu) and display the console, open the rendering panel and select PRINT in the Emulate CSS Media menu.

Emulation of styles for printing in Chrome

3. Absolute Units of Measurement

Absolute units of measurement is bad on the screen, but excellent for printing. In print styles, their use is completely safe and even recommended to use such units as CM, MM, IN, PT or PC.

Section (Margin-Bottom: 2cm;)

4. Specific rules for pages

You can set properties specific to a printed page, such as its size, orientation and indents using the @page directive. It is very convenient if you want all pages to have certain indents.

@Media Print (@page (Margin: 1cm;))

Directive @page This is part of the Paged Media Module specification, in which there are such wonderful things as the ability to choose the first printed page or empty pages, position the elements in the corner of the page and much more. It can be used even to print books.

5. Page Rasch Management

Since printed pages, unlike web pages, are not infinite, the content will be broken between pages. We have 5 properties to manage how this happens.

Tarve the page in front of the element.

If we want the element always at the beginning of the page, we can set a compulsory page break using the Page-Break-Beore rule.

Section (Page-Break-before: Always;)

Spread the page after the element.

The Page-Break-After rule allows us to forcing or prohibit page breaks after an item.

H2 (Page-Break-After: Always;)

Page break inside the element

This property is convenient if you need to avoid breaking the page inside the element.

UL (Page-Break-Inside: Avoid;)

Widow and orphans (hanging lines)

Sometimes you do not need control over the page break, but it is important to control how many lines will be displayed on the current, and how much on the next page. For example, if the last line of the paragraph does not fit on the current page, it will be transferred to the next page along with the penultimate. This is because the corresponding property of Widows by default is 2. We can change it.

P (widows: 4;)

If we encounter the other side of this problem and on the current page we only placed on the first line of the paragraph, then the entire paragraph will start with the next page. For this corresponds to the Orphans property and its default value 2.

P (Orphans: 3;)

This code means that at least 3 lines must be placed on the current page so that the paragraph is not transferred to the next one.

Not all of these properties and values \u200b\u200bwork in each browser, you must check styles for printing in different browsers.

6. Reset styles

It makes sense to reset some styles such as Background-Color, Box-Shadow and Color.

*, *: Before, *: After, *: first-letter, P: first-line, div: first-line, Blockquote: First-Line, Li: First-Line (Background: Transparent! Important; Color: # 000 ! Important; Box-Shadow: None! Important; Text-Shadow: None! Important;)

Styles for printing is one of those few exceptions when using a key word! Important is quite normal.

7. Removing optional content

To avoid excessive waste of ink, you must delete unnecessary - fooling elements, advertising, navigation, etc. Using the Display: None property.

You, in principle, can show only the main content and hide everything else:

Body\u003e *: Not (Main) (Display: None;)

8. Print link addresses

A: AfterTr (CONTENT: "(" ATTR (HREF) ")";)

Of course, this will be shown all: relative references, absolute links, anchors and so on. The following option will work better:

A: not (): AfterTr (CONTENT: "(" ATTR (HREF) ")";)

Looks insanely, I know. These lines work like this: The value of the HREF attribute is displayed next to any link that it has if it starts with HTTP, but does not lead to our mywebsite.com.

9. Printing decodes of abbreviation

Abbreviations must turn around the element With the decryption in the title attribute. It makes sense to bring it on print.

ABBR: After (Content: "(" Attr (title) ")";)

10. Stamp background

Usually browsers do not print background color and background images if you directly specify them. There is a non-standard Print-Color-Adjust property, which allows you to rewrite default settings in some browsers.

Header (-WebKit-Print-Color-Adjust: Exact; Print-Color-Adjust: Exact;)

11. Media register

If you write media register as in the following example, keep in mind that styles in this media register will not be applied when printing.

@Media Screen and (MIN-WIDTH: 48EM) (/ * Screen Only * /)

You will ask why? Because CSS rules apply only when performing both conditions: MIN-WIDTH is 48EM, Media-Type - Screen. If you get rid of the keyword screen, then the media register will take into account only the MIN-WIDTH value.

@Media (MIN-WIDTH: 48EM) (/ * All Media Types * /)

12. Printing cards

The current versions of Firefox and Chrome are capable of printing cards, but Safari is not. Some services provide static maps that can be printed instead of the original.

Map (width: 400px; Height: 300px; Background-image: URL ("http://maps.googleapis.com/maps/api/staticmap?center\u003dwien+floridsdorf&zoom\u003d13&scale\u003dfalse&size\u003d400x300&maptype\u003droadmap&format\u003dpng&visual_refresh\u003dtrue "); -WebKit-print-Color-ADJUST: EXACT; Print-Color-Adjust: Exact;)

13. QR codes

Supplement 2: Gutenberg

If you are looking for a framework, you may like the gutenberg that makes the optimization of pages a bit simpler.

Supplement 3: Hartija

This is another framework to create styles for printing from

Periodically on the Internet you can meet so valuable articles that I want to print them and read it to the holes. At the same time, not all services provided by the version of the article for printing or our desires print do not coincide with the capabilities provided (I want to leave a picture or change the type of main font). How to print a page without unnecessary elements? In this case, the web service will help.

On the main page of PrintWhatyoulike in the middle of the screen there is a mold for entering the address of the page to be selected. The address was entered, the page is loaded and we see that when choosing any of the interface elements, it will be burned with a red frame. Another press of the left mouse button and opens a list of possible operations. The elements of the interface can be deleted by one or group, expand separately selected within or select one block of text, removing all other. That is, it is possible to remove unnecessary pages unnecessary to print or quickly isolate the necessary from the secondary and print.

On the left side of the screen there is a side panel with a number of functions for the editable page:

  • saving the editable page in PDF, HTML formats;
  • changing the size of the text, type of font;
  • deleting the rear background or images with one touch of the mouse button.

For the convenience of PRINTWHATYOULIKE, it offers to put a button on the bookmarks panel to edit before printing any, visiting the page. P2zipper option is also provided. It will be convenient when reading those resources where they love to divide one article for five, ten or more pages. You click "Next Page", once again "next page", and then you understand that there was nothing to read. P2zipper will spread the entire article on the entire page for further editing and printing. If the bookmaker does not want to put, then the plugin is available for Firefox PageZipper 0.6.1.

For registered users, PrintWhatyoulike offers the control panel, which contains information on the number of buttons installed by Printer Friendly buttons, saved and printed sheets of paper, saved money, not constructed trees and not thrown into the atmosphere of ill-coal carbon oxide.

Bloggers can also benefit. The installation of the plug-in will appear on each page of the Blog convenient button to send articles to print, the ability to save pages into PDF format, which will save the readers for paper and paint the printer.

Often on sites can be found version for printing a page or another page. Many people think that this is something embedded in the browser itself or what it is done is very simple. In fact, it's not at all. Print version is a regular page.that you need alone To do.

You can look at the version for printing from this article. In fact, what should be displayed there? Title of article, section, category, author, text and date. All this and is derived to this page. Do you need a menu, search form, various blocks? I do not think so there are no them.

Also make sure the width of the version for printing does not exceed 650pxOtherwise, the browser can cut the edges.

So, you already understood that print version You need to create yourself, withdrawing exactly what is needed by the user. Now about how to do it.

there is 2 options: Create a separate page and create a separate style file. The first option, I think, is understandable. Create another page with print version And on the main page, give a link to this printed version. The user passes through it and through "File" -\u003e "Print" He will print it.

The second option involves the creation of a separate style sheet, where you hide all the extra blocks (through display: None;) And put the appropriate size from the output content. Further, such a style file is connected as follows:

Now if the user wants to print this page, it will not be printed what he sees, but what is spelled out in print.css.. In fact, the user sees a page in one form, and the printer is in a completely different one.

So this way created Print version Any site page.

Obtaining private data does not always mean hacking - sometimes they are published in general access. Knowledge of Google settings and a little smelting will make a lot of interesting - from credit card numbers to FBI documents.

Warning

All information is provided solely for informational purposes. Neither the editors nor the author are responsible for any possible harm caused by the materials of this article.

Today it is connected to the Internet today, a little caring about restricting access. Therefore, many private data becomes mining search engines. Robots- "Spiders" are no longer limited to web pages, and indexes the entire content available on the network and is constantly added to their databases not intended to disclose information. You just know these secrets - you just need to know how to ask about them.

We are looking for files

In the skillful hands, Google will quickly find everything that lies badly on the network - for example, personal information and service files. They are often hiding as the key under the rug: there are no access restrictions, the data is simply lying on the backyards of the site where the links do not lead. The standard Google web interface provides only the basic settings of the extended search, but even them will be enough.

Limit the search for files of a specific type in Google using two operators: FileType and EXT. The first sets the format that the search engine has defined the header of the file, the second is the file extension, regardless of its internal content. When searching in both cases, you only need to specify the extension. Initially, the EXT statement was convenient to use in cases where the specific features of the file format were absent (for example, to search for configuration files INI and CFG, inside which everything can be). Now Google algorithms have changed, and there is no visible difference between operators - the results in most cases are the same.


Filter issuing

By default, the words and generally any entered Google characters are searched for all files on indexed pages. You can limit the search area on the top level domain, a specific site or at the location of the desired sequence in the files themselves. For the first two options, the SITE statement is used, after which the domain name or selected site is entered. In the third case, a whole set of operators allows you to search for information in office fields and metadata. For example, Allinurl will delete the links specified in the body, Allinanchor - in the text equipped with the tag , Allintitle - in the headlines of the pages, AllinText - in the body of pages.

For each operator, there is a lightweight version with a shorter name (without an ALL console. The difference is that Allinurl will delete links with all words, and Inurl is only with the first of them. The second and subsequent words from the query can occur on web pages anywhere. The inurl operator also has differences from another similar meaning - Site. The first also allows you to find any sequence of characters in the reference to the desired document (for example, / CGI-BIN /), which is widely used to search for components with known vulnerabilities.

Let's try in practice. We take the AllinText filter and do so that the request gives the list of numbers and verification codes of credit cards, the validity of which will expire only in two years (or when their owners get tired of feeding all in a row).

Allintext: Card Number Expiration Date / 2017 CVV

When you read in the news that the young hacker "hacked the servers" of Pentagon or NASA, staring the secret information, then in most cases it is about such an elementary technique for using Google. Suppose we are interested in the list of NASA employees and their contact details. Surely such a list is in electronic form. For convenience or by overwhelming, it can lie on the site itself. It is logical that in this case it will not be links, since it is intended for internal use. What words can be in such a file? At least - the "address" field. Check all these assumptions are easier than simple.


INURL: NASA.GOV FILETIPE: XLSX "ADDRESS"


We use bureaucracy

Similar finds are a nice little thing. The truly solid catch provides more detailed knowledge of Google operators for webmasters, the network itself and the features of the structure of the desired. Knowing details, you can easily filter out the issuance and clarify the properties of the desired files so that in the remainder to get really valuable data. It's funny that bureaucracy comes to the rescue. It creates typical wording, for which it is convenient to look for a chance-leaning secret information.

For example, a Distribution Statement is mandatory in the Office of the US Department of Defense Means Standardized Restrictions on Document Distribution. Litera A marked public releases, in which there is nothing secret; B - intended for internal use, C is strictly confidential and so on to F. Separately, it is worth the letter X, which marks particularly valuable information representing the state mystery of the highest level. Let such documents are looking for those who should be done on the debt of the service, and we are limited to files with Literary C. According to DODI 5230.24 directive, such marking is assigned to documents containing a description of critical technologies that fall under export control. You can detect so carefully protected information on sites in the top level domain.mil allocated for the US Army.

"Distribution Statement C" Inurl: Navy.mil

It is very convenient that only websites from the US MO and its contract organizations are collected in the domain.mil domain. The search for a domain restriction is extremely clean, and the headlines - speaking themselves for themselves. Search in this way Russian secrets is almost useless: chaos reigns in domains.ru, and the names of many weapons systems sound like botanical (PP "Kiparis", ACS "Acacia") or at all fabulous (Tos "Buratino").


Carefully examining any document from the site in the.mil domain, other markers can be seen to refine the search. For example, reference to the export restrictions "SEC 2751", which is also convenient to look for interesting technical information. From time to time it is taken from official sites, where she once lit up, so if the search for extradition does not manage to proceed by an interesting link, use the Google Cash (Cache operator) or the Internet Archive site.

We climb into the clouds

In addition to accidentally declassified documents of government departments, in Kesche Google, sometimes referenced links to personal files from Dropbox and other storage services that create "private" references to publicly published data. With alternative and homemade services even worse. For example, the next query finds the data of all Verizon clients, in which the FTP server is installed on the router.

Allinurl: FTP: // Verizon.net

These clever people now found more than forty thousand, and in the spring of 2015 they were an order of magnitude more. Instead of Verizon.net, you can substitute the name of any famous provider, and what it will be known, the larger there may be a catch. Through the built-in FTP server, the files are visible on the external drive connected to the router. Usually it is NAS for remote work, personal cloud or some pyring rocking chair. All contents of such media are indexed by Google and other search engines, so you can access the files stored on external disks by direct link.

We spy the configs

Prior to the clouds to the clouds, simple FTP servers in which there were also enough vulnerabilities also told the clouds as remote storages. Many of them are relevant so far. For example, the popular WS_FTP Professional program configuration data, user accounts and passwords are stored in the WS_FTP.ini file. It is easy to find and read, since all records are stored in a text format, and passwords are encrypted by the Triple DES algorithm after the minimum obfuscation. In most versions, it is enough just to discard the first byte.

Decipher such passwords are easy using the WS_FTP Password Decryptor utility or free web service.

Speaking about hacking an arbitrary site, usually imply a password from logs and backups of CMS configuration files or e-commerce applications. If you know their typical structure, you can easily specify keywords. Rows like those encountered in WS_FTP.ini are extremely common. For example, in Drupal and PrestaShop, there is a user ID (UID) and the corresponding password (PWD), and all information in files with extension is stored .INC. Search for them as follows:

"pwd \u003d" "uid \u003d" ext: inc

Reveal passwords from DBMS

In the configuration files of SQL servers, the names and email addresses of users are stored in an open form, and instead of passwords are recorded by their MD5 hash. To decipher them, strictly speaking, it is impossible, however, you can find compliance among well-known steam hash password.

There are still databases that do not even use password hashing. Configuration files from any of them can be simply viewed in the browser.

INTEXT: DB_PASSWORD FileType: ENV

With the appearance on Windows servers, the place of configuration files partly occupied the registry. Search by its branches can be exactly the same way using REG as a file type. For example, like this:

FileType: REG HKEY_CURRENT_USER "PASSWORD" \u003d

Do not forget about the obvious

Sometimes you can get to closed information with the help of accidentally open and in the field of view of Google data. The perfect option is to find a list of passwords in any common format. Store account information in a text file, Word document or E-table Excel can only desperate people, but just enough them.

FileType: XLS Inurl: Password

On the one hand, there are plenty of means to prevent such incidents. You must specify adequate access rights to HTACCESS, Patt CMS, do not use left scripts and close other holes. There is also a file with an exception list of Robots.txt, prohibiting search engines to index the files and directories specified in it. On the other hand, if the structure of robots.txt on some server differs from the standard, it immediately becomes clear that they are trying to hide on it.

The list of directories and files on any site is preceded by the standard inscription index of. Since it must meet in the title for service purposes, it makes sense to limit its search by the intitle operator. Interesting things are in directories / admin /, / personal /, / etc /, and even / secret /.

Follow the updates

The relevance is very important here: the old vulnerabilities close very slowly, but Google and his search Issument are constantly changing. There is a difference even between the "Last Second" filter (& tbs \u003d QDR: S in the end of the request) and "real-time" (& tbs \u003d qdr: 1).

The time interval of the date of the last update of the file in Google is also indicated implicitly. Through the graphic web interface, you can choose one of the standard periods (hour, day, week, and so on) or set the date range, but this method is not suitable for automation.

According to the appearance of the address bar, you can only guess about the method to limit the output of the results using the & TBS \u003d QDR :. The letter y after it sets the limit of one year (& tbs \u003d qdr: y), M shows the results over the last month, W - for the week, D - over the past day, H - for the last hour, n - per minute, and s - for give me a sec. The freshest results that have just become famous Google are using the filter & TBS \u003d QDR: 1.

If you want to write a cunning script, it will be useful to know that the date range is set in Google in Julian format through the DateRange statement. For example, here you can find a list of PDF documents with the word Confidential, downloaded from January 1 to July 1, 2015.

Confidential FileType: PDF DateRange: 2457024-2457205

The range is indicated in the format of Julian dates without taking into account the fractional part. Translate them manually from the Gregorian calendar is inconvenient. It is easier to use the dates converter.

Targeting and filter again

In addition to specifying additional operators in the search query, you can send directly in the link body. For example, clarifying filetype: PDF corresponds to the design AS_FileType \u003d PDF. Thus, it is convenient to set any clarifications. Suppose the issuance of results only from the Republic of Honduras is given by adding CR \u003d Countryhn to the search URL, and only from the city of Bobruisk - GCS \u003d Bobruisk. In the Developer section you can find a complete list.

Google automation means are designed to ease life, but often add problems. For example, by IP of the user through WHOIS is determined by its city. Based on this information in Google, the load between servers is not only balanced, but also change the results of search results. Depending on the region, with the same query, different results will fall on the first page, and some of them can be at all hidden. Feeling a cosmopolitan and look for information from any country will help its two-letter code after the GL \u003d Country directive. For example, the code of the Netherlands - NL, and the Vatican and North Korea on Google is not allowed.

Often the search for issuance turns out to be littering even after using several advanced filters. In this case, it is easy to clarify the request by adding a few exceptions to it (before each of them is a minus sign). For example, according to Personal, Banking, Names and Tutorial are often used. Therefore, more pure search results will show not a curcent example of a request, but a refined:

INTITLE: "INDEX OF / PERSONAL /" -NAMES -TUTORIAL -BANKING

An example is finally

The sophisticated hacker is characterized by ensuring themselves with everything necessary on their own. For example, VPN is a convenient thing, but either expensive or temporary and limitations. Prepare a subscription for yourself one too expensive. It is good that there are group subscriptions, and with the help of Google it is easy to become part of some group. To do this, it is enough to find the Cisco VPN configuration file, which has a fairly non-standard PCF extension and a recognizable path: Program Files \\ Cisco Systems \\ VPN Client \\ Profiles. One request, and you enter, for example, in a friendly team of the University of Bonn.

FileType: PCF VPN OR GROUP

Info.

Google finds configuration files with passwords, but many of them are written in an encrypted form or replaced with hash. If you see the rows of fixed length, then the decryption service is immediately looking for.

Passwords are stored in an encrypted form, but Maurice Massar has already written a program for their decryption and provides it for free through thecampusgeeks.com.

With Google, hundreds of different types of attacks and penetration tests are performed. There are many options affecting popular programs, the main database formats, numerous PHP vulnerabilities, clouds, and so on. If you make sure that you are looking for, it will greatly simplify obtaining the necessary information (especially the one that did not plan to make the universal property). Not shodan Single feeds interesting ideas, but every base of indexed network resources!