Home >Web Front-end >HTML Tutorial >Media attribute of Bootstrap css_html/css_WEB-ITnose

Media attribute of Bootstrap css_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:27954browse

The following piece of code is implemented: the maximum width of the device is 767px. When the device width is greater than 767px, the background color is #000, otherwise it is #f00. The code is as follows:

<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Media Queries</title><style>body{background:#000;}@media (max-width:767px){body{background:#f00;}}  <!-- 设备最大宽度为767px,当设备宽度大于767px就是#000,否则就是#f00 --></style></head><body></body></html>

Let’s expand media a little:

CSS Media property
Screen: refers to the computer screen.

Print: refers to the opaque media used for printers.

Projection: refers to the project used for display.
braille: Braille system, refers to printed matter with tactile effects.
Aural: refers to a speech electronic synthesizer.
tv: refers to television-type media.
handheld: refers to a handheld display device (small screen, monochrome)
all: suitable for all media.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn