Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 11 lesson 3

<!DOCTYPE html>
<html>
<head>
<title>Hiding elements using Media Queries</title>
<style>
.text {
@media screen and(max-width:600px){
text{
display: none;
}
}
}
h1{
background-color: #cdb4db;
padding: 20px;
font-family: cursive;
text-align: center;
}
</style>
</head>
<body>
<h1 class="text">Studytonight</h1>
<p>When the browser's width is 600px wide or less, hide the h1 element. Resize the browser window to see the effect.</p>
</body>
</html>
by

2 Answers

kshitijrana14
Try this one
<!DOCTYPE html>
<html>
<head>
<title>Hiding elements using Media Queries</title>
<style>
@media(max-width:600px){
.text {
display: none;
}
}
h1{
background-color: #cdb4db;
padding: 20px;
font-family: cursive;
text-align: center;
}
</style>
</head>
<body>
<h1 class="text">Studytonight</h1>
<p>When the browser's width is 600px wide or less, hide the h1 element. Resize the browser window to see the effect.</p>
</body>
</html>
jarixa
Thank you this helped me.

Login / Signup to Answer the Question.