Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

css display only on mobile

<#-- Display only on destop and tablet -->
<div class="screenDisplay">
  <p>This is only displayed on desktop and tabled</p>
</div>
  
<#-- Display only on mobile -->
<div class="mobileDisplay">
  <p>This is only displayed if on mobile</p>
</div>
  
<#-- On the CSS file we use -->
  // ONLY FOR MOBILE
@media (max-width: 767px) {
	.screenDisplay{
		display:none
	}
}

// ONLY FOR DESKTOP AND TABLET
@media only screen and (min-width: 768px) {
  .mobileDisplay{
		display:none
	}
 }
 
PREVIOUS NEXT
Tagged: #css #display #mobile
ADD COMMENT
Topic
Name
2+7 =