Query Media in CSS
@media in CSS is a feature that allows us to customize CSS to fit different devices like desktop, tablet, smartphone, TV device and printing device .
These media queries will look at different aspects such as the viewport's width and height, the width and height of the display device, the direction of use is horizontal or vertical along with a specific resolution to adjust for well suited.
@Media syntax
This attribute has the following syntax:
@media not|only mediatype and (media feature) {
CSS-Code;
}
Media Type
Media Feature
Some examples
1. If the browser width is less than or equal to 600px, hide the element div class example
@media screen and (max-width: 600px) {
div.example {
display: none;
}
}
Full code:
Hide the div when the screen size is smaller
TipsMake.com is a social network about science and technology, expanding content to
meeting members' needs for more technology fields such as electricity
voice, smart device, electronics, computer security .
2. If the browser width is greater than 800px, set the lavender, 400px to 999px background color to lightsalmon, less than 400px then lightblue.
body {
background-color: lightblue;
}
@media screen and (min-width: 400px) {
body {
background-color: lightgreen;
}
}
@media screen and (min-width: 800px) {
body {
background-color: lavender;
}
}
![]()
Website TipsMake.com
TipsMake.com is a social network about science and technology, expanding content to
meeting members' needs for more technology fields such as electricity
voice, smart device, electronics, computer security .
3. Create a flexible navigation menu that displays multiple interface sizes (displayed horizontally on a large screen and vertically on a small screen):
@media screen and (max-width: 600px) {
.topnav a {
float: none;
width: 100%;
}
}
Website TipsMake.com
TipsMake.com is a social network about science and technology, expanding content to
meeting members' needs for more technology fields such as electricity
voice, smart device, electronics, computer security .
Làng Công nghệ
Công nghệ
Cuộc sống
4. Create flexible display columns interface that meets a variety of interface sizes.
/* hiển thị 2 cột thay vì 4 cột mặc định khi màn hình có chiều rộng dưới 920px*/
@media screen and (max-width: 992px) {
.column {
width: 50%;
}
}
/* các cột xếp chồng lên nhau thay vì cạnh nhau khi màn hình có chiều rộng dưới 600px */
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
You resize the browser to see the change:
Website TipsMake.com
QTM
Some text .
QTM
Some text .
QTM
Some text .
QTM
Some text .
5. Create layout website display flexibly to meet many interface sizes.
Page Title
Website TipsMake.com
Knowledge - Experience - FAQ
Using flexible layout.
Làng Công nghệ
Công nghệ
Khoa học
Cuộc sống
Introduce
TipsMake.com is a social network about science and technology.
Highlights
Follow Me
YouTube
Form - Form in CSS
Quách Tỉnh, February 14, 2019
Forms are an integral part of any kind of website.
In this article, TipsMake.com will show you how to build the section
giao diện hiển thị của một biểu mẫu cơ bản. Giao diện này có thể được làm
khá đẹp mắt với CSS
Attribute Selector in CSS
Quách Tỉnh, February 14, 2019
Attribute selector is the way to select the elements you want to type in
tài liệu HTML dựa vào thuộc tính của một hay nhiều thẻ HTML nào đó.
Attribute selector can select objects without having to
khai báo thêm các Class hoặc ID vào trong thẻ HTML và vẫn có thể hướng
được đến các thành phần đó, giúp code gọn gàng hơn và mạch lạc hơn.
License No. 362 / GP-BTTTT. Ministry of Information and Communications issued on June 30, 2016.
You should read it
- Summary of shortcuts in Windows Media Player
- 5 social media trends in 2014
- How to Protect Your Kids on Social Media
- VLC Media Player 3.0.11
- How to fix 3 problems with VLC Media Player
- How to Download Windows Media Center
- How to record webcam videos on VLC Media Player
- Set up VLC Media Player as the default multimedia player on Windows 10
May be interested
- Query command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Alternate Criteria in Access 2016in addition to the uses of the tipsmake.com query introduced in the previous lessons, you can also view data and records that meet two or more conditions using the alternative criteria.
- 5 best SQL query optimization software to speed up MySQLthe sql query optimizer analyzes many options for a given query, estimates the cost of each of these options, and finally, selects the lowest cost option.
- Subquery - SUBQUERY in SQLsubquery is a query inside another sql query and is embedded in the where clause.
- Options to create data queries in Access 2016in this article, we will learn how to modify and sort queries in query design view, as well as how to use totals functions to create queries that can compute data. you will also learn more about other query options in access 2016.
- MS Access 2003 - Lesson 22: Using Query Wizardsaccess includes 4 different types of wizard queries, and only one where you can see all of those query types. select query from the insert menu, access displays the new query dialog box as shown in figure 1.
- LINQ clears query barriersunified programming solution, which provides the ability to query sql syntax data directly in c # or vb.net, applies to all types of data from objects to relational databases and xml.
- The quser (query user) command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Qprocess (query process) command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- How to Check the Query Performance in an SQL Serverthis wikihow teaches you how to to use the sql server query store to monitor the performance of your database queries. open the sql server management studio. you can use the query store feature of sql server to monitor your database for...