I have a layout that looks well in normal browsers, but in links and lynx is looks like a large jumble of text. I'd like to add a <hr>
or <br>
between sections in the text browsers, but I don't want them to interfere with the CSS layout in normal browsers. I tried setting hr {display: none;}
in the CSS, but it's also hiding it in the text browsers.

- 645
- 1
- 7
- 14
-
4Text browsers applying CSS? ***Shocking.*** – BoltClock Dec 13 '13 at 16:23
-
try to use to specify the css that will show br and hr only for media using a fixed-pitch character grid. – kawashita86 Dec 13 '13 at 16:41
-
@kawashita86 works great, you should add an answer for that – Lucas Phillips Dec 13 '13 at 16:45
-
thanks, i've added the answer as you suggested. :) – kawashita86 Dec 13 '13 at 16:57
1 Answers
UPDATE 21/12/2016: tty will be deprecated (along with a lot of other media types that you can check here https://drafts.csswg.org/mediaqueries/#media-types) and should be substituted with a combination of media feature, a method that is a more fine-grained test than media types, testing a single, specific feature of the user agent or display device. For targeting a text browsers you can ty with a combination with the grid plus monochrome feature.
ORIGINAL ANSWER:
As Paul stated, you should use the media queries to let the browsers select the css that suits better for the device/browser. For text browser, such as lynx and links, you should use the following media query:
tty
that is the format suited for media using a fixed-pitch character grid.
To target CSS rules you can import the css files with <link>
tag specifing the media like this:
<link rel='stylesheet' media='tty' href='lynx.css' />
or by defining the media inside a css file using the following syntax :
@media tty {
my-lynx-css-rule {
...
}
}
for a detailed description of the available media queries, please check the following page: http://cssmediaqueries.com/what-are-css-media-queries.html

- 1,555
- 3
- 18
- 25
-
media type tty is deprecated http://www.w3schools.com/cssref/css3_pr_mediaquery.asp – Luke Nov 25 '16 at 04:04
-
2I wouldn't use w3schools as a reference. Related MDN entry regarding deprecated media types: https://developer.mozilla.org/en-US/docs/Web/CSS/@media#Media_types – alecdwm Mar 13 '17 at 09:09