How to learn Responsive Web Design with @media query in

We can use @media query in  CSS file.

CSS media queries to assign different stylesheets depending on browser window size.

@media query css style sheet applied according to the browser widths.

We also use @media query to design Responsive website.

Responsive  web design approach, a web page can adjust itself on the device it’s being displayed on.

Example of @media query

Create new website in visual studio, and create new stylesheet in

Apply the Stylesheet on webform….

<html xmlns=””>
<head runat=”server”>
<title>Untitled Page</title>

<meta name=”viewportcontent=”width=device-width, initial-scale=1” />

<link href=”StyleSheet.css” rel=”stylesheet” type=”text/css” />
<form id=”form1″ runat=”server”>


The StyleSheets file code :


@media screen and (max-width:800px)


Here, we create stylesheet with @media query.

The Stylesheet Describe the body background color Blue of webpage, but when we changed width of browser up to maximum 800px body background color will be Red.

The output of @media query is:

What Is Responsive Web Design
Responsive Web Design with @media query in

I hope this post well help you…..


Leave a Reply

Your email address will not be published. Required fields are marked *