Zaloguj | Zarejestruj | FAQ
Anonymous

how to hide a <p> on a mobile site?

+ Odpowiedz

Posty: 3 Strona 1 z 1


how to hide a <p> on a mobile site?

przez bananaxo » So lut 13, 2016 9:59 pm

i created a css file that looks like this:
.hide {
display: none;
}

i have it linked at the top of my html file:
<link type="text/css" rel="stylesheet" media="only screen and (max-device-width:480px) and (orientation: landscape)" href="landscape.css"/>

used it in my html file: <p class= "hide">... </p>

what am i missing or doing wrong? :(
Avatar użytkownika

bananaxo

  • Posty: 1
  • Dołączył(a): So lut 13, 2016 9:48 pm

Re: how to hide a <p> on a mobile site?

przez johnmacd » Cz kwi 14, 2016 1:03 pm

Try using <div>:

<div class="mobile-only" style="font-size: 0; max-height: 0; overflow: hidden; display: none">
<!--// Everything inside is invisible to desktop //-->
</div>
Avatar użytkownika

johnmacd

  • Posty: 23
  • Dołączył(a): Cz cze 13, 2013 12:50 pm
--
Website Designer with 7 years experience as WordPress Developer. Affordable, Professional and Experienced. 100% Satisfaction. 24/7 Available.

Re: how to hide a <p> on a mobile site?

przez Farhin Qureshi » Cz sty 12, 2017 12:21 pm

It works perfectly correct using the same code:
Kod: Zaznacz cały
<!DOCTYPE html>
<html>
   <head>
   <style>
   .hide {
display: none;
}
   </style>
   </head>
<body>
<p >hello </p>
</body>
</html>
.
Avatar użytkownika

Farhin Qureshi

  • Posty: 45
  • Dołączył(a): Wt sty 03, 2017 11:33 am
--
Farhin Qureshi
.NET Developer
http://www.ifourtechnolab.com


+ Odpowiedz

Strona 1 z 1